-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathDockerfile
38 lines (25 loc) · 800 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
FROM node:17 as build
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY src ./src
COPY assets ./assets
COPY webpack.* ./
COPY all-tests.js ./
COPY test ./test
COPY .babelrc ./
RUN npm test
RUN npm run build-app-prod
RUN npm run build
#===============================================
FROM node:17-bullseye-slim
WORKDIR /usr/bin/app
COPY docker-entry.sh /usr/bin/app/entry.sh
RUN chmod +x /usr/bin/app/entry.sh
COPY assets /usr/bin/app/assets
COPY html /usr/bin/app/html
COPY --from=build /usr/src/app/node_modules /usr/bin/app/node_modules
COPY --from=build /usr/src/app/dist/assets/*.js /usr/bin/app/assets/
COPY --from=build /usr/src/app/dist/server /usr/bin/app/server
COPY --from=build /usr/src/app/dist/common /usr/bin/app/common
ENTRYPOINT [ "/usr/bin/app/entry.sh" ]