generated from codegouvfr/eleventy-dsfr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.bitnami
51 lines (36 loc) · 1.2 KB
/
Dockerfile.bitnami
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
FROM node:18 as builder
ARG http_proxy
ARG https_proxy
ARG npm_registry
ARG no_proxy
# ENV NODE_ENV production
# Create app directory
WORKDIR /usr/src/app
# use proxy & private npm registry
# With internal npm repo (autosigned) disable strict ssl : strict-ssl false
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo "Europe/Paris" > /etc/timezone ; \
if [ ! -z "$http_proxy" ] ; then \
npm config delete proxy; \
npm config set proxy $http_proxy; \
npm config set https-proxy $https_proxy ; \
npm config set no-proxy $no_proxy; \
fi ; \
[ -z "$npm_registry" ] || npm config set registry=$npm_registry ; \
[ -z "$npm_registry" ] || npm config set strict-ssl false
RUN npm cache clean -force
# copy all dependances
COPY package.json .
# copy all source files into app workdir
COPY . .
# install dependencies
RUN npm install
RUN echo "installation"
# build
RUN npm run build
RUN npm run postbuild
# run production static api
FROM bitnami/nginx:1.24 AS web
WORKDIR /usr/share/nginx/html/
COPY --from=builder /usr/src/app/_site ./
COPY --from=builder /usr/src/app/_site/fr/index.html ./index.html
COPY nginx/nginx-run.template /opt/bitnami/nginx/conf/server_blocks/webserver.conf