forked from nginx-proxy/nginx-proxy
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.debian
39 lines (30 loc) · 1.47 KB
/
Dockerfile.debian
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
FROM docker.io/nginxproxy/docker-gen:0.14.2-debian AS docker-gen
FROM docker.io/nginxproxy/forego:0.18.2-debian AS forego
# Build the final image
FROM docker.io/library/nginx:1.27.2
ARG NGINX_PROXY_VERSION
# Add DOCKER_GEN_VERSION environment variable because
# acme-companion rely on it (but the actual value is not important)
ARG DOCKER_GEN_VERSION="unknown"
ENV NGINX_PROXY_VERSION=${NGINX_PROXY_VERSION} \
DOCKER_GEN_VERSION=${DOCKER_GEN_VERSION} \
DOCKER_HOST=unix:///tmp/docker.sock
# Configure Nginx
RUN echo "\ninclude /etc/nginx/toplevel.conf.d/*.conf;" >> /etc/nginx/nginx.conf \
&& sed -i 's/worker_connections.*;$/worker_connections 10240;/' /etc/nginx/nginx.conf \
&& sed -i -e '/^\}$/{s//\}\nworker_rlimit_nofile 20480;/;:a' -e '$!N;$!ba' -e '}' /etc/nginx/nginx.conf \
&& mkdir -p '/etc/nginx/toplevel.conf.d' \
&& mkdir -p '/etc/nginx/dhparam' \
&& mkdir -p '/etc/nginx/certs' \
&& mkdir -p '/usr/share/nginx/html/errors'
# Install Forego + docker-gen
COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego
COPY --from=docker-gen /usr/local/bin/docker-gen /usr/local/bin/docker-gen
COPY network_internal.conf /etc/nginx/
COPY app nginx.tmpl LICENSE /app/
WORKDIR /app/
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["forego", "start", "-r"]
# Enable https passthrough configuration using streams
RUN sed -E -i '/^http \{/i\stream {\n include /etc/nginx/nginx-stream.conf;\n}\n\n' /etc/nginx/nginx.conf && \
touch /etc/nginx/nginx-stream.conf