-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 906 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
#############
### build ###
#############
# base image
FROM node:12.2 as build
# set working directory
WORKDIR /app/razorboard
ENV PATH /app/razorboard/node_modules/.bin:$PATH
# add app
COPY . /app
# generate build
RUN npx npm-force-resolutions && \
npm update && \
npm run build -- --prod --output-path=dist
############
### prod ###
############
# base image
FROM nginx:1.19-alpine
# copy artifact build from the 'build environment'
COPY --from=build /app/razorboard/dist/* /usr/share/nginx/html/
COPY docker-utils/razorboard-http.conf /etc/nginx/conf.d/razorboard-http.conf.available
COPY docker-utils/razorboard-https.conf /etc/nginx/conf.d/razorboard-https.conf.available
COPY docker-utils/30-disable-default.sh /docker-entrypoint.d/
COPY docker-utils/40-tune-server.sh /docker-entrypoint.d/
# expose port 80
EXPOSE 80
# run nginx
CMD ["nginx", "-g", "daemon off;"]