From 9551b318e9b1ca0c5b5b448c7c3cdbce8f69ae75 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sun, 23 Jul 2023 03:51:21 -0400 Subject: Split main proxy and acme containers Split the nginx-proxy and acme-companion services into separate git repositories, to ease the deployment of systems which won't (or can't) use the acme helper. This necessitates bringing back the user-defined network. All other containers (not just acme) interacting with the proxy will need to use it. Signed-off-by: Malfurious --- docker-compose.yml | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3b7ca0b..445e501 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,25 +1,21 @@ version: "3.7" -services: - nginx-proxy: - container_name: "nginx-proxy" - image: "nginxproxy/nginx-proxy" - volumes: - - "certs:/etc/nginx/certs" - - "dhparam:/etc/nginx/dhparam" - - "vhost:/etc/nginx/vhost.d" - - "html:/usr/share/nginx/html" - - "/var/run/docker.sock:/tmp/docker.sock:ro" - restart: "always" - ports: - - "80:80" - - "443:443" +# Services requiring Lets Encrypt certificates should join the +# 'nginx-proxy-network' network and define BOTH the environment +# variables 'VIRTUAL_HOST' and 'LETSENCRYPT_HOST' to the DNS name +# they use. +# +# This container requires the use of the nginx-proxy service. +# +# See more info here: https://github.com/nginx-proxy/acme-companion +services: acme-companion: container_name: "acme-companion" image: "nginxproxy/acme-companion" - depends_on: - - "nginx-proxy" + restart: "always" + environment: + NGINX_PROXY_CONTAINER: "nginx-proxy" volumes: - "acme:/etc/acme.sh" - "certs:/etc/nginx/certs" @@ -27,13 +23,20 @@ services: - "vhost:/etc/nginx/vhost.d" - "html:/usr/share/nginx/html" - "/var/run/docker.sock:/var/run/docker.sock:ro" - environment: - NGINX_PROXY_CONTAINER: "nginx-proxy" - restart: "always" + networks: + - "nginx-proxy-network" volumes: acme: certs: + external: true dhparam: + external: true vhost: + external: true html: + external: true + +networks: + nginx-proxy-network: + external: true -- cgit v1.2.3