-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 761 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 761 Bytes
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
##### Build Image #####
FROM node:16 AS builder
WORKDIR /audreyasked
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY prisma .
RUN npx prisma generate
COPY . .
RUN yarn build
##### Runtime Image #####
FROM node:16
ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV production
WORKDIR /usr/src/app
COPY --from=builder /audreyasked/prisma ./prisma
COPY --from=builder /audreyasked/public ./public
COPY --from=builder /audreyasked/dist ./dist
COPY --from=builder /audreyasked/next.config.js ./next.config.js
COPY --from=builder /audreyasked/.next/ ./.next
COPY --from=builder /audreyasked/node_modules/ ./node_modules
COPY --from=builder /audreyasked/package.json/ ./package.json
CMD ["sh", "-c", "npx prisma migrate deploy && yarn start"]