forked from freeCodeCamp/chapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.Dockerfile
More file actions
33 lines (22 loc) · 795 Bytes
/
server.Dockerfile
File metadata and controls
33 lines (22 loc) · 795 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
32
FROM node:16-alpine as development
WORKDIR /usr/chapter/
FROM development as build
# Bundle app source
COPY server ./server
COPY common ./common
COPY package*.json ./
RUN npm ci -w=server --ignore-scripts --include-workspace-root
RUN npm -w=server run build
FROM node:16-alpine as production
WORKDIR /usr/chapter/
COPY package*.json ./
COPY server/package.json ./server/package.json
RUN npm ci -w=server --ignore-scripts --include-workspace-root --omit=dev
COPY --from=build /usr/chapter/common ./common
COPY --from=build /usr/chapter/server/src ./server/src
COPY --from=build /usr/chapter/server/prisma ./server/prisma
COPY --from=build /usr/chapter/server/reminders ./server/reminders
RUN npx -w=server prisma generate
EXPOSE 5000
WORKDIR /usr/chapter/server
CMD [ "npm", "start" ]