Newer
Older
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 0, based on Node.js, to build and compile Angular
FROM node:12.13.0 as builder
WORKDIR /app
# Copy the package.json file first in order to cache the modules
COPY ./package.json .
COPY ./package-lock.json .
COPY ./patch.js .
# Install npm dependencies
RUN npm install
# Launch postinstall script (to include crypto module)
RUN npm run postinstall
# Copy the project
COPY ./angular.json .
COPY ./tsconfig.json .
COPY ./src ./src
ARG conf
# Building the Angular app /dist i18n
RUN npm run build-i18n:${conf}
# Stage 1, based on Nginx, to have only the compiled app
FROM nginx
## Install dependency to get lua module in .conf
RUN apt-get update
RUN apt-get --assume-yes install nginx-extras
RUN rm /etc/nginx/conf.d/*
COPY --from=builder /app/dist/fr /usr/share/nginx/html
COPY --from=builder /app/dist/en /usr/share/nginx/html/en
RUN ls -l /usr/share/nginx/html