2022-08-20 04:42:29 +02:00
|
|
|
FROM node:18.7.0 AS base
|
2020-03-17 18:30:27 +01:00
|
|
|
|
2022-01-05 21:47:02 +01:00
|
|
|
# Install ffmpeg
|
2022-01-26 02:16:29 +01:00
|
|
|
RUN apt-get update && \
|
2022-05-15 20:54:59 +02:00
|
|
|
apt-get install -y ffmpeg tini && \
|
2022-01-26 02:16:29 +01:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2020-03-17 18:30:27 +01:00
|
|
|
|
2022-03-26 17:33:56 +01:00
|
|
|
# Install dependencies
|
|
|
|
FROM base AS dependencies
|
|
|
|
|
2020-03-17 18:30:27 +01:00
|
|
|
WORKDIR /usr/app
|
|
|
|
|
2021-01-07 18:54:32 +01:00
|
|
|
COPY package.json .
|
|
|
|
COPY yarn.lock .
|
2020-03-17 18:30:27 +01:00
|
|
|
|
2020-12-03 22:08:07 +01:00
|
|
|
RUN yarn install --prod
|
2020-11-18 21:14:16 +01:00
|
|
|
|
2022-03-26 17:33:56 +01:00
|
|
|
# Only keep what's necessary to run
|
|
|
|
FROM base AS runner
|
2020-10-24 21:19:35 +02:00
|
|
|
|
2022-03-26 17:33:56 +01:00
|
|
|
WORKDIR /usr/app
|
2020-10-24 21:19:35 +02:00
|
|
|
|
2022-03-26 17:33:56 +01:00
|
|
|
COPY --from=dependencies /usr/app/node_modules node_modules
|
2020-03-17 18:30:27 +01:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2022-03-13 02:38:33 +01:00
|
|
|
RUN yarn prisma generate
|
2020-10-24 21:19:35 +02:00
|
|
|
|
2022-02-05 23:16:17 +01:00
|
|
|
ARG COMMIT_HASH=unknown
|
2022-03-26 22:51:34 +01:00
|
|
|
ARG BUILD_DATE=unknown
|
2022-02-05 23:16:17 +01:00
|
|
|
|
2020-03-17 18:30:27 +01:00
|
|
|
ENV DATA_DIR /data
|
2022-02-05 23:16:17 +01:00
|
|
|
ENV NODE_ENV production
|
|
|
|
ENV COMMIT_HASH $COMMIT_HASH
|
2022-03-26 22:51:34 +01:00
|
|
|
ENV BUILD_DATE $BUILD_DATE
|
2020-03-17 18:30:27 +01:00
|
|
|
|
2022-05-15 20:54:59 +02:00
|
|
|
CMD ["tini", "--", "yarn", "start"]
|