2016-10-04 09:32:47 +02:00
|
|
|
FROM nginx:stable
|
|
|
|
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
|
|
|
|
|
|
|
|
# Default variables
|
2020-05-13 11:27:10 +02:00
|
|
|
ENV NGINX_HOST localhost 127.0.0.1
|
2021-03-29 09:51:14 +02:00
|
|
|
ENV NGINX_PORT 8080
|
|
|
|
ENV NGINX_SSL_PORT 8443
|
2021-03-29 22:26:53 +02:00
|
|
|
ENV NGINX_EXTERNAL_PORT 80
|
|
|
|
ENV NGINX_EXTERNAL_SSL_PORT 443
|
2021-03-29 20:13:54 +02:00
|
|
|
ENV CERTIFICATE_PATH /etc/nginx/certs/req.pem
|
|
|
|
ENV CERTIFICATE_KEY_PATH /etc/nginx/certs/cert.key
|
|
|
|
ENV SSL_PROTOCOLS TLSv1.2 TLSv1.3
|
|
|
|
ENV SSL_CIPHERS ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
|
2021-03-30 10:53:25 +02:00
|
|
|
ENV CLIENT_BODY_BUFFER_SIZE 1K
|
|
|
|
ENV CLIENT_HEADER_BUFFER_SIZE 1k
|
|
|
|
ENV CLIENT_MAX_BODY_SIZE 1k
|
2021-09-17 15:43:13 +02:00
|
|
|
ENV LARGE_CLIENT_HEADER_BUFFERS 4 8k
|
2016-10-04 09:32:47 +02:00
|
|
|
|
|
|
|
# Create sensible CERTS
|
|
|
|
RUN mkdir /etc/nginx/certs
|
|
|
|
COPY req.pem cert.key dhparams.pem /etc/nginx/certs/
|
|
|
|
#
|
|
|
|
# Clean, copy templates and usefull files
|
|
|
|
RUN rm /etc/nginx/conf.d/*
|
|
|
|
COPY launch.sh /launch.sh
|
|
|
|
RUN mkdir /etc/nginx/templates
|
2021-04-29 15:15:01 +02:00
|
|
|
COPY nginx.conf /etc/nginx/
|
2016-10-04 09:32:47 +02:00
|
|
|
COPY root.conf /etc/nginx/templates/
|
|
|
|
|
|
|
|
# Dot not daemonize nginx
|
|
|
|
RUN echo 'daemon off;' >> /etc/nginx/nginx.conf
|
|
|
|
|
2021-03-29 09:51:14 +02:00
|
|
|
# nginx user (no root)
|
|
|
|
RUN touch /var/run/nginx.pid && \
|
|
|
|
chown -R nginx:nginx /var/run/nginx.pid && \
|
|
|
|
chown -R nginx:nginx /var/cache/nginx && \
|
|
|
|
chown -R nginx:nginx /etc/nginx/
|
|
|
|
|
|
|
|
USER nginx
|
|
|
|
|
2016-10-04 09:32:47 +02:00
|
|
|
CMD bash /launch.sh
|