-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (20 loc) · 743 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
FROM node:20-slim AS builder
ENV NODE_ENV production
WORKDIR /iQbe
COPY [ "package.json", "./" ]
COPY [ "scripts", "./scripts" ]
COPY [ "packages/backend/package.json", "./packages/backend/" ]
COPY [ "packages/frontend/package.json", "./packages/frontend/" ]
COPY [ "packages/api/package.json", "./packages/api/" ]
RUN [ "npm", "install", "--omit=dev" ]
COPY --link --chown=node:node . ./
USER node
RUN [ "npm", "run", "api" ]
RUN [ "npm", "run", "build" ]
FROM node:20-slim AS prod
WORKDIR /iQbe
COPY --from=builder "/iQbe/packages/backend/built" "./packages/backend/built"
COPY --from=builder "/iQbe/node_modules" "./node_modules"
COPY --from=builder "/iQbe/package.json" "./package.json"
EXPOSE 9000
CMD [ "npm", "run", "start" ]