-
Notifications
You must be signed in to change notification settings - Fork 93
/
Dockerfile
42 lines (22 loc) · 1.02 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
### STAGE 1: Build ###
# We label our stage as ‘builder’
FROM node:10-alpine as builder
RUN npm install -g ionic [email protected]
WORKDIR /app
COPY . ./
RUN npm install
RUN mkdir -p ./www
RUN cordova platform add browser@latest
RUN ionic cordova build browser
### STAGE 2: Setup ###
FROM nginx:1.14.1-alpine
## Copy our default nginx config
COPY nginx.conf /etc/nginx/nginx.conf
## Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/platforms/browser/www/ /usr/share/nginx/html
COPY --from=builder /app/src/chat-config-template.json /usr/share/nginx/html
COPY --from=builder /app/src/firebase-messaging-sw-template.js /usr/share/nginx/html
WORKDIR /usr/share/nginx/html
RUN echo "Chat21 Ionic Started!!"
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/chat-config-template.json > /usr/share/nginx/html/chat-config.json && envsubst < /usr/share/nginx/html/firebase-messaging-sw-template.js > /usr/share/nginx/html/firebase-messaging-sw.js && exec nginx -g 'daemon off;'"]