forked from seokho-son/cb-mapui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (29 loc) · 1.12 KB
/
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
#############################################################
## Stage 1 - Build static files
#############################################################
FROM node:18-alpine AS builder
WORKDIR /app
COPY ./package.json ./package-lock.json ./
RUN npm config set fetch-retries 5 \
&& npm config set fetch-retry-mintimeout 20000 \
&& npm config set fetch-retry-maxtimeout 120000 \
&& npm install --silent --no-audit --prefer-offline
COPY . .
RUN npm run build
RUN npm prune --production
#############################################################
## Stage 2 - App
#############################################################
FROM node:18-alpine AS prod
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/img ./dist/img
COPY --from=builder /app/index.html ./
COPY --from=builder /app/index.js ./
COPY --from=builder /app/redoc-swagger.html ./
COPY --from=builder /app/swagger.html ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package-lock.json ./package-lock.json
COPY --from=builder /app/package.json ./package.json
EXPOSE 1324
ENTRYPOINT ["npm", "start"]