forked from linagora/esn-frontend-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (23 loc) · 864 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
ARG NODE_VERSION=12.19
ARG NGINX_VERSION=1.19.3
### STAGE 1: Build the AngularJS app ###
FROM node:${NODE_VERSION} as build-stage
ARG BASE_HREF=/admin/
ARG APP_GRID_ITEMS="[{ \"name\": \"Calendar\", \"url\": \"/calendar/\" }, { \"name\": \"Contacts\", \"url\": \"/contacts/\" }, { \"name\": \"Inbox\", \"url\": \"/inbox/\" }]"
WORKDIR /app
COPY package.json /app/
RUN npm install
COPY . .
# Production mode build
RUN npm run build:prod
### STAGE 2: Add Nginx for hosting the AngularJS app ###
FROM nginx:${NGINX_VERSION} as production-stage
# Removes the default nginx html files
RUN rm -rf /usr/share/nginx/html/*
# Copy the bundle
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Copy the default nginx.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
# Start Nginx server
CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]