2020-10-24 21:19:35 +02:00
|
|
|
FROM node:14-alpine AS base
|
2020-03-17 18:30:27 +01:00
|
|
|
|
2020-11-18 20:32:28 +01:00
|
|
|
# Install ffmpeg and build dependencies
|
|
|
|
RUN apk add --no-cache ffmpeg python make g++
|
2020-03-17 18:30:27 +01:00
|
|
|
|
|
|
|
WORKDIR /usr/app
|
|
|
|
|
2020-10-24 21:19:35 +02:00
|
|
|
COPY package* ./
|
2020-03-17 18:30:27 +01:00
|
|
|
|
2020-10-24 21:19:35 +02:00
|
|
|
# Dependencies
|
|
|
|
FROM base AS dependencies
|
|
|
|
|
|
|
|
RUN npm install
|
|
|
|
|
|
|
|
# Build app
|
|
|
|
FROM dependencies AS builder
|
2020-03-17 18:30:27 +01:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2020-10-24 21:19:35 +02:00
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
RUN npm i --only=prod
|
2020-03-17 18:30:27 +01:00
|
|
|
|
|
|
|
ENV DATA_DIR /data
|
|
|
|
|
2020-10-24 21:19:35 +02:00
|
|
|
CMD ["npm", "run", "start"]
|