-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile_20220902
27 lines (20 loc) · 971 Bytes
/
Dockerfile_20220902
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
#-------------------------------------------
# STEP 1 : build executable binary
#-------------------------------------------
FROM node:18.8.0-alpine as builder
ADD . /usr/src/app
WORKDIR /usr/src/app
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
RUN npm rebuild esbuild
RUN npm install --no-optional
RUN npm run generate
#-------------------------------------------
# STEP 2 : build a image
#-------------------------------------------
FROM nginx:1.23.1-alpine
RUN rm -rf /usr/share/nginx/html/connect /usr/share/nginx/html/device /usr/share/nginx/html/event /usr/share/nginx/html/system /usr/share/nginx/html/tag /usr/share/nginx/html/test /usr/share/nginx/html/user /usr/share/nginx/html/auth /usr/share/nginx/html/emit-prop /usr/share/nginx/html/monitoring /usr/share/nginx/html/dashboard
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
ENV HOST 0.0.0.0
ENV BACKEND_PORT 3001
ENTRYPOINT [ "nginx", "-g", "daemon off;" ]