prepare docker-compose.yml for deployment

This commit is contained in:
Linden Crandall 2025-02-07 09:11:33 +09:00
parent 7ca2f27ac6
commit 243cb035da

View File

@ -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