blob: 0d48149366ffe7a3f07f27271bf5f9419d602ea2 [file] [log] [blame]
Nico Huber4f21f5c2023-07-21 14:19:54 +00001FROM nginx:1.24-alpine
Nico Huber38c14da2023-06-24 16:59:28 +00002
3ARG SELFSIGNED_REQ_HOST
4ARG SELFSIGNED_REQ_ALT_NAMES
Nico Huberf3c71252023-07-21 13:03:49 +00005RUN test "${SELFSIGNED_REQ_HOST}" || { echo "Require SELFSIGNED_REQ_HOST argument."; exit 1; }
6RUN \
Nico Huber38c14da2023-06-24 16:59:28 +00007 apk add openssl && \
8 printf "DE\nHassia\nEschborn\nSource Arcade\nWeb\n${SELFSIGNED_REQ_HOST}\n\n" | \
9 openssl req -x509 -nodes -days 14 -newkey rsa:2048 \
10 -addext "subjectAltName = ${SELFSIGNED_REQ_ALT_NAMES}" \
11 -keyout /etc/ssl/private/sa-selfsigned.key \
12 -out /etc/ssl/certs/sa-selfsigned.crt && \
13 apk del openssl
14
Nico Huberba887d02023-07-25 16:59:06 +000015COPY Dockerfile.entrypoint /nginx-entrypoint
Nico Huberd6528722023-07-01 14:38:39 +000016RUN chmod 544 /nginx-entrypoint
17
18ENTRYPOINT ["/bin/sh", "/nginx-entrypoint"]
19CMD ["nginx", "-g", "daemon off;"]