-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile1
44 lines (34 loc) · 901 Bytes
/
Dockerfile1
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
42
43
44
# FROM node:16.14.0-alpine
#
# WORKDIR /app
# COPY --chown=node:node package*.json ./
# RUN yarn install --production
# RUN npx prisma generate
# COPY . .
# RUN yarn build
#
#
# CMD ["yarn", "start:prod"]
FROM node:16-alpine AS builder
# Create app directory
WORKDIR /app
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package.json ./
COPY yarn.lock ./
COPY prisma ./prisma/
# Install app dependencies
RUN yarn install
COPY . .
RUN yarn build
FROM node:16-alpine as production
ARG DATABASE_URL=${DATABASE_URL}
ARG JWT_SECRET=${JWT_SECRET}
ARG BULL_HOST=${BULL_HOST}
ARG BULL_PORT=${BULL_PORT}
ARG BULL_PASSWORD=${BULL_PASSWORD}
ARG PORT=${PORT}
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
CMD ["yarn", "run", "start:prod"]