Files
server_proxy/docker-compose.yml
2021-02-28 00:33:45 -05:00

110 lines
2.6 KiB
YAML

version: '3.7'
services:
proxy:
build:
context: ./proxy
args:
USER_UID: ${UID_PROXY:-12001}
GROUP_UID: ${UID_PROXY:-12001}
env_file:
# contains DOMAINS and SERVER variable
# DOMAINS: rootA.com www api\nrootB.com www mail
# SERVER: webA webB
- ./files/domains.env
restart: always
image: proxy
container_name: proxy
ports:
- "80:8080"
- "443:8443"
networks:
- service_web
- service_certbot
- backend_proxy
volumes:
# cert volume
- proxy_ssl:/service/ssl:ro
# /.well-known/acme-challenge/ volume
- proxy_certbot:/service/html/certbot:ro
# custom config mount
# can be used to set custom locations for upstream server
# has to have the same name as the upstream server to be loaded
- ./files/upstream_configs:/upstream_configs:ro
certbot:
depends_on:
- proxy
build:
context: ./certbot
args:
USER_UID: ${UID_CERTBOT:-12002}
GROUP_UID: ${UID_PROXY:-12002}
env_file:
# contains DOMAINS and SERVER variable
# DOMAINS: rootA.com www api\nrootB.com www mail
# SERVER (not used by certbot): webA webB
- ./files/domains.env
# cerbot container will be set to testing
# unless PRODUCTION var is set (any value) in the environment
- ./production.env # set PRODUCTION= here
restart: always
image: certbot
container_name: certbot
networks:
- service_certbot
volumes:
# cert volume
- proxy_ssl:/service/ssl:rw
# /.well-known/acme-challenge/ volume (webroot)
- proxy_certbot:/service/html:rw
# certbot directories
- certbot_ssl:/service/letsencrypt/ssl:rw
- certbot_work:/service/letsencrypt/work:rw
- certbot_logs:/service/letsencrypt/log:rw
# TODO: put this in its own docker-compose
# as the proxy does not require it
web:
build:
context: ./web
args:
USER_UID: ${UID_WEB:-12003}
GROUP_UID: ${UID_WEB:-12003}
restart: always
image: web
container_name: web
networks:
- service_web
# volumes:
# - service_web:/service/html:ro
volumes:
# proxy volumes
proxy_ssl:
name: proxy_ssl
proxy_certbot:
name: proxy_certbot
proxy_www:
name: proxy_www
# certbot volumes
certbot_ssl:
name: certbot_ssl
certbot_work:
name: certbot_work
certbot_logs:
name: certbot_logs
# service volumes
service_web:
name: service_web
networks:
service_web:
name: service_web
service_certbot:
name: service_certbot
backend_proxy:
name: backend_proxy
external: true