mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-12 21:05:29 +01:00
56a469a999
Co-authored-by: Federico fuji97 Rapetti <fuji1097@gmail.com>
46 lines
771 B
Docker
46 lines
771 B
Docker
FROM node:16.13.0 AS base
|
|
|
|
# Install ffmpeg
|
|
RUN apt-get update && \
|
|
apt-get install -y ffmpeg && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /usr/app
|
|
|
|
COPY package.json .
|
|
COPY yarn.lock .
|
|
|
|
# Install prod dependencies
|
|
RUN yarn install --prod
|
|
|
|
# Dependencies
|
|
FROM base AS dependencies
|
|
|
|
# Install dev dependencies
|
|
RUN yarn install
|
|
|
|
# Build app
|
|
FROM dependencies AS builder
|
|
|
|
COPY . .
|
|
|
|
RUN yarn prisma generate && yarn build
|
|
|
|
# Only copy essentials
|
|
FROM base AS prod
|
|
|
|
COPY --from=builder /usr/app/dist dist
|
|
COPY --from=builder /usr/app/schema.prisma .
|
|
COPY --from=builder /usr/app/migrations migrations
|
|
|
|
RUN yarn prisma generate
|
|
|
|
ARG COMMIT_HASH=unknown
|
|
|
|
ENV DATA_DIR /data
|
|
ENV NODE_ENV production
|
|
ENV BUILD_DATE $(date)
|
|
ENV COMMIT_HASH $COMMIT_HASH
|
|
|
|
CMD ["yarn", "start"]
|