diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f605902 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +**/*.mp4 +**/*.m4a +**/*.m4v diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2a0d1af --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:18-alpine + +RUN apk add ffmpeg && mkdir /src + +WORKDIR /src + +COPY ./package.json . + +RUN npm install + +COPY . . + +CMD ["bin", "sh"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..30d4b6e --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +DOCKER := docker +IMAGE_NAME := vimeo-private-downloader +IMAGE_VERSION := latest +CURRENT_DIR := $(shell pwd) + +build: + @$(DOCKER) build . -t $(IMAGE_NAME):$(IMAGE_VERSION) + +start: + @$(DOCKER) run --rm -it -v $(CURRENT_DIR):/src $(IMAGE_NAME):$(IMAGE_VERSION) npm run start + +combine: + @$(DOCKER) run --rm -it -v $(CURRENT_DIR):/src $(IMAGE_NAME):$(IMAGE_VERSION) npm run combine + +bash: + @$(DOCKER) run --rm -it -v $(CURRENT_DIR):/src $(IMAGE_NAME):$(IMAGE_VERSION) /bin/sh diff --git a/README.md b/README.md index 33d2f7b..8338165 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,16 @@ To download videos you have to: To combine and convert video/audio parts to `mp4` file run in terminal `sh vimeo-combine.sh` or `npm run combine` and enjoy! +## Docker configuration + +There is a Dockerfile available in the repository which uses Alpine image with Node 18 installed. + +Several Makefile commands have been added in order to +- `make build`: builds `FROM node:18-alpine` Docker image installing `ffmpeg` OS dependency as well +- `make start`: executes `npm run start` entrypoint +- `make convert`: executes `npm run convert` entrypoint +- `make bash`: Runs sh command in a running container + ### Contributors Special thanks to contributors: