From 243cb035daeeae3305a63d462683860c5fa19eb5 Mon Sep 17 00:00:00 2001 From: Linden Crandall Date: Fri, 7 Feb 2025 09:11:33 +0900 Subject: [PATCH] prepare docker-compose.yml for deployment --- docker-compose.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 07f4523..4d1c981 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,45 @@ version: '3.9' +networks: + proxy: + driver: bridge + default: + name: automatisch_network + enable_ipv6: ${ENABLE_IPV6} + ipam: + config: + - subnet: 2001:db8::/64 services: + # for local https development using self-signed certs via openssl + # nginx: + # image: nginx:latest + # depends_on: + # - main + # ports: + # - "443:443" + # volumes: + # - ./https/certs/${SSL_SELF_SIGNED_CRT}:/etc/nginx/certs/${SSL_SELF_SIGNED_CRT}:ro + # - ./https/certs/${SSL_SELF_SIGNED_KEY}:/etc/nginx/certs/${SSL_SELF_SIGNED_KEY}:ro + # - ./https/nginx/automatisch_self_signed_nginx.conf:/etc/nginx/conf.d/ + # for production using letsencrypt and certbot + nginx: + image: nginx:latest + depends_on: + - main + restart: unless-stopped + volumes: + - ./https/nginx/automatisch_letsencrypt_nginx.conf:/etc/nginx/conf.d/ + - ./certbot/conf:/etc/letsencrypt + - ./certbot/www:/var/www/certbot + ports: + - ${PORT}:${PORT} + - 443:443 + + certbot: + image: certbot/certbot:latest + volumes: + - ./certbot/conf:/etc/letsencrypt + - ./certbot/www:/var/www/certbot + command: certonly --webroot -w /var/www/certbot --keep-until-expiring --email ${SSL_CERT_EMAIL} -d ${HOST} --agree-tos main: build: context: ./docker