-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (36 loc) · 1.23 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# stage1 as builder
FROM node:alpine3.10 as qr-builder
# copy the package.json to install dependencies
COPY scanner/package.json scanner/yarn.lock ./
# Install the dependencies and make the folder
RUN yarn && mkdir /qr-scanner
WORKDIR /qr-scanner
COPY scanner/ .
# Build the project and copy the files
RUN yarn run build
# stage2 as builder
FROM node:alpine3.10 as report-builder
# copy the package.json to install dependencies
COPY report/package.json report/yarn.lock ./
# Install the dependencies and make the folder
RUN yarn && mkdir /checkin-report
WORKDIR /checkin-report
COPY report/ .
# Build the project and copy the files
RUN yarn run build
FROM nginx:alpine
#!/bin/sh
COPY ./nginx.conf /etc/nginx/nginx.conf
## Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*
# Copy from stage 1
COPY --from=qr-builder /qr-scanner/build /usr/share/nginx/html/qr-scanner
RUN ls -l /usr/share/nginx/html
# Copy from stage 2
COPY --from=report-builder /checkin-report/build /usr/share/nginx/html/checkin-report
COPY index.html /usr/share/nginx/html/
RUN ls -l /usr/share/nginx/html
RUN chown nginx:nginx /usr/share/nginx/html/*
RUN chmod 755 -R /usr/share/nginx/html/
EXPOSE 8000 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]