Switch back to NPM, optimize Dockerfile

This commit is contained in:
Max Isom 2020-10-24 15:19:35 -04:00
parent f941dbbddd
commit a51c712da8
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
21 changed files with 4043 additions and 20427 deletions

View file

@ -1,19 +1,33 @@
FROM jrottenberg/ffmpeg:4.0-scratch
FROM node:13
FROM node:14-alpine AS base
# Copy ffmpeg bins
COPY --from=0 / /
# Install ffmpeg
RUN apk add --no-cache ffmpeg
WORKDIR /usr/app
COPY package.json .
COPY package* ./
RUN yarn install
# Dependencies
FROM base AS dependencies
RUN npm install
# Build app
FROM dependencies AS builder
COPY . .
RUN yarn run build
RUN npm run build
RUN ls
# Only copy essentials
FROM base AS prod
RUN ls
COPY --from=builder /usr/app/dist dist
RUN npm i --only=prod
ENV DATA_DIR /data
CMD ["yarn", "start"]
CMD ["npm", "run", "start"]