forked from getodk/central
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.dockerfile
38 lines (25 loc) · 1007 Bytes
/
nginx.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
FROM node:20.17.0-slim AS intermediate
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
gettext-base \
&& rm -rf /var/lib/apt/lists/*
COPY ./ ./
RUN files/prebuild/write-version.sh
RUN files/prebuild/build-frontend.sh
# when upgrading, look for upstream changes to redirector.conf
# also, confirm setup-odk.sh strips out HTTP-01 ACME challenge location
FROM jonasal/nginx-certbot:5.4.0
EXPOSE 80
EXPOSE 443
# Persist Diffie-Hellman parameters and/or selfsign key
VOLUME [ "/etc/dh", "/etc/selfsign" ]
RUN apt-get update && apt-get install -y netcat-openbsd
RUN mkdir -p /usr/share/odk/nginx/
COPY files/nginx/setup-odk.sh /scripts/
RUN chmod +x /scripts/setup-odk.sh
COPY files/nginx/redirector.conf /usr/share/odk/nginx/
COPY files/nginx/common-headers.conf /usr/share/odk/nginx/
COPY --from=intermediate client/dist/ /usr/share/nginx/html
COPY --from=intermediate /tmp/version.txt /usr/share/nginx/html
ENTRYPOINT [ "/scripts/setup-odk.sh" ]