-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
45 lines (25 loc) · 687 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
42
43
44
45
FROM node:20.12.2-alpine3.18 as backendBuild
LABEL stage=build
ENV NODE_ENV=PRODUCTION
COPY oss-api/ ./
WORKDIR /oss-api
RUN npm install -g npm@10.5.2
RUN npm install
RUN npm run build
FROM node:20.12.2-alpine3.18 as frontendBuild
LABEL stage=build
ENV NODE_ENV=PRODUCTION
COPY frontend/ ./frontend/
RUN cd /frontend/
WORKDIR /frontend/
RUN npm install -g npm@10.5.2
RUN npm install
RUN npm run build:prod
FROM node:20.12.2-alpine3.18 as prod
COPY --from=backendBuild dist dist
COPY --from=backendBuild node_modules/ dist/node_modules
COPY --from=frontendBuild client client
ENV PORT=5000
ENV NODE_ENV=PRODUCTION
EXPOSE 5000/tcp 9464/tcp
CMD ["node", "dist/main.js"]