From e14335bdff7ea6bfce3d167f7ba3edcc0f02b499 Mon Sep 17 00:00:00 2001 From: janderedev Date: Wed, 25 Aug 2021 22:25:37 +0200 Subject: [PATCH] dockering hard --- Dockerfile | 17 +++++++++++++++++ docker-compose.yml | 10 ++++++++++ package.json | 3 +++ yarn.lock | 5 +++++ 4 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..38c56e2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:14-stretch AS build +WORKDIR /build/ +COPY package.json yarn.lock ./ +RUN yarn install --frozen-lockfile +COPY . . +RUN yarn build + +FROM node:14-stretch AS prod +WORKDIR /app/ +RUN apt-get update -y +RUN apt-get install -y ffmpeg +COPY --from=build /build/package.json /build/yarn.lock ./ +COPY --from=build /build/dist ./dist +COPY assets ./assets +RUN yarn install --production --frozen-lockfile + +CMD ["yarn", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..16df154 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3' +services: + app: + build: . + restart: unless-stopped + ports: + - "6969:6969" + volumes: + # the directory where the transcoded videos are "cached" + - ./temp:/app/tmp \ No newline at end of file diff --git a/package.json b/package.json index 63f54cd..840c8fd 100644 --- a/package.json +++ b/package.json @@ -16,5 +16,8 @@ "@types/fluent-ffmpeg": "^2.1.18", "express": "^4.17.1", "fluent-ffmpeg": "^2.1.2" + }, + "devDependencies": { + "typescript": "^4.3.5" } } diff --git a/yarn.lock b/yarn.lock index b5863f6..1413127 100644 --- a/yarn.lock +++ b/yarn.lock @@ -439,6 +439,11 @@ type-is@~1.6.17, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +typescript@^4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" + integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"