forked from ChatWithPDF/bff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 884 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM node:16 AS builder
# Create app directory
WORKDIR /app
# copy dependency files
COPY package.json ./
COPY yarn.lock ./
COPY prisma ./prisma/
# Install app dependencies
RUN yarn install
# Required if not done in postinstall
# RUN npx prisma generate
COPY . .
RUN yarn run build
FROM node:16
WORKDIR /app
RUN apt update && apt install -y ffmpeg
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
COPY --from=builder /app/yarn.lock ./
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/files ./files
ARG ENV
ENV CI_ENV=${ENV}
ARG SERVER_RELEASE_VERSION
ENV SERVER_RELEASE_VERSION=${SERVER_RELEASE_VERSION}
EXPOSE 3000
CMD ["/bin/sh", "-c", "if [ \"$CI_ENV\" = \"CI\" ]; then npm run start:migrate:ci; else npm run start:migrate:prod; fi"]
# CMD [ "npm", "run", "start:prod" ]