68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
# Main reverse proxy for both staging and production
|
|
version: '3.8'
|
|
|
|
services:
|
|
nginx-proxy:
|
|
image: nginx:latest
|
|
container_name: cmc-nginx-proxy
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./conf/nginx-proxy.conf:/etc/nginx/nginx.conf
|
|
- lego_certificates:/etc/ssl/certs:ro
|
|
- lego_acme_challenge:/var/www/acme-challenge:ro
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- nginx-staging
|
|
- nginx-production
|
|
networks:
|
|
- proxy-network
|
|
- cmc-staging-network
|
|
- cmc-production-network
|
|
|
|
lego:
|
|
image: goacme/lego:latest
|
|
container_name: cmc-lego
|
|
volumes:
|
|
- lego_certificates:/data/certificates
|
|
- lego_accounts:/data/accounts
|
|
- lego_acme_challenge:/data/acme-challenge
|
|
- ./scripts:/scripts:ro
|
|
environment:
|
|
- LEGO_DISABLE_CNAME=true
|
|
command: sleep infinity
|
|
restart: unless-stopped
|
|
networks:
|
|
- proxy-network
|
|
|
|
# Import staging services
|
|
nginx-staging:
|
|
extends:
|
|
file: docker-compose.staging.yml
|
|
service: nginx-staging
|
|
networks:
|
|
- proxy-network
|
|
- cmc-staging-network
|
|
|
|
# Import production services
|
|
nginx-production:
|
|
extends:
|
|
file: docker-compose.production.yml
|
|
service: nginx-production
|
|
networks:
|
|
- proxy-network
|
|
- cmc-production-network
|
|
|
|
volumes:
|
|
lego_certificates:
|
|
lego_accounts:
|
|
lego_acme_challenge:
|
|
|
|
networks:
|
|
proxy-network:
|
|
driver: bridge
|
|
cmc-staging-network:
|
|
external: true
|
|
cmc-production-network:
|
|
external: true |