2021-12-26 04:56:55 +01:00
|
|
|
FROM node:17-alpine AS base
|
2020-03-17 18:30:27 +01:00
|
|
|
|
2020-11-18 20:32:28 +01:00
|
|
|
# Install ffmpeg and build dependencies
|
2021-11-12 20:30:18 +01:00
|
|
|
RUN apk add --no-cache ffmpeg python2 make g++
|
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-11-18 21:14:16 +01:00
|
|
|
# Install prod dependencies
|
2020-12-03 22:08:07 +01:00
|
|
|
RUN yarn install --prod
|
2020-11-18 21:14:16 +01:00
|
|
|
|
2020-10-24 21:19:35 +02:00
|
|
|
# Dependencies
|
|
|
|
FROM base AS dependencies
|
|
|
|
|
2020-11-18 21:14:16 +01:00
|
|
|
# Install dev dependencies
|
2020-12-03 22:08:07 +01:00
|
|
|
RUN yarn install
|
2020-10-24 21:19:35 +02:00
|
|
|
|
|
|
|
# Build app
|
|
|
|
FROM dependencies AS builder
|
2020-03-17 18:30:27 +01:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2020-12-03 22:08:07 +01:00
|
|
|
RUN yarn build
|
2020-10-24 21:19:35 +02:00
|
|
|
|
|
|
|
# Only copy essentials
|
|
|
|
FROM base AS prod
|
2020-10-24 21:42:37 +02:00
|
|
|
|
2020-10-24 21:19:35 +02:00
|
|
|
COPY --from=builder /usr/app/dist dist
|
|
|
|
|
2020-03-17 18:30:27 +01:00
|
|
|
ENV DATA_DIR /data
|
|
|
|
|
2020-12-03 22:08:07 +01:00
|
|
|
CMD ["yarn", "start"]
|