muse/Dockerfile

46 lines
771 B
Docker
Raw Normal View History

FROM node:16.13.0 AS base
2020-03-17 18:30:27 +01:00
2022-01-05 21:47:02 +01:00
# Install ffmpeg
RUN apt-get update && \
apt-get install -y ffmpeg && \
rm -rf /var/lib/apt/lists/*
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
RUN yarn install --prod
2020-11-18 21:14:16 +01:00
# Dependencies
FROM base AS dependencies
2020-11-18 21:14:16 +01:00
# Install dev dependencies
RUN yarn install
# Build app
FROM dependencies AS builder
2020-03-17 18:30:27 +01:00
COPY . .
2022-01-05 21:47:02 +01:00
RUN yarn prisma generate && yarn build
# Only copy essentials
FROM base AS prod
2020-10-24 21:42:37 +02:00
COPY --from=builder /usr/app/dist dist
2022-01-06 21:26:37 +01:00
COPY --from=builder /usr/app/schema.prisma .
COPY --from=builder /usr/app/migrations migrations
RUN yarn prisma generate
ARG COMMIT_HASH=unknown
2020-03-17 18:30:27 +01:00
ENV DATA_DIR /data
ENV NODE_ENV production
ENV BUILD_DATE $(date)
ENV COMMIT_HASH $COMMIT_HASH
2020-03-17 18:30:27 +01:00
CMD ["yarn", "start"]