-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
34 lines (28 loc) · 893 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
# https://hub.docker.com/_/node
# ==== Builder Image
FROM node:16.17.0-alpine as build
WORKDIR /app
# [ℹ] Installs required node packages
COPY package.json package-lock.json ./
# RUN apk add --no-cache git
# [ℹ] Installs required APK packages:
# [ℹ] https://pkgs.alpinelinux.org/packages
# [ℹ] example-use: https://superuser.com/questions/1055060/how-to-install-a-specific-package-version-in-alpine
# [ℹ] example-use: https://superuser.com/questions/1198215/fixate-version-alpine-linux-apk-package-in-container
RUN apk add --no-cache \
python3=3.10.9-r0 \
make=4.3-r0 \
g++=11.2.1_git20220219-r2 \
&& npm i --omit=optional
# [ℹ] Builds node application
COPY . .
RUN npm run build
# ==== Final Image
FROM node:16.17.0-alpine as final
USER node:node
WORKDIR /app
COPY --from=build /app .
COPY . .
EXPOSE 5055
# CMD ["node", "./build"]
CMD ["npm", "run", "start:docker"]