forked from nginx-boilerplate/nginx-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
21 lines (21 loc) · 732 Bytes
/
Dockerfile
File metadata and controls
21 lines (21 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM nginx:alpine
RUN apk add --no-cache openssl
RUN echo $'[req] \n\
distinguished_name = req_distinguished_name \n\
x509_extensions = v3_req \n\
prompt = no \n\
[req_distinguished_name] \n\
CN = *.localhost \n\
[v3_req] \n\
keyUsage = keyEncipherment, dataEncipherment \n\
extendedKeyUsage = serverAuth \n\
subjectAltName = @alt_names \n\
[alt_names] \n\
DNS.1 = *.localhost \n\
DNS.2 = localhost' > openssl.cnf
RUN mkdir -p /run/secrets/
RUN openssl req -new -newkey rsa:2048 -sha1 -days 3650 -nodes -x509 -keyout /run/secrets/cert.key -out /run/secrets/cert.crt -config openssl.cnf
COPY . /etc/nginx/
RUN ln -sf /dev/stdout /var/log/nginx/bots.access.log
RUN rm openssl.cnf
RUN apk del openssl