From 63d771e70e0082a8c590315521b0be6b0af75769 Mon Sep 17 00:00:00 2001 From: Andruten Date: Sat, 25 Feb 2023 00:04:27 +0100 Subject: [PATCH 1/2] Added docker support --- .dockerignore | 3 +++ Dockerfile | 13 +++++++++++++ Makefile | 16 ++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 Makefile 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 From 78844b88cbb03e003491d866bb9f5cf3c20d49c9 Mon Sep 17 00:00:00 2001 From: andruten Date: Mon, 27 Feb 2023 09:40:03 +0100 Subject: [PATCH 2/2] Updated README.md including new Docker configuration --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) 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: