[mod] proxy nginx config is now generated based on domains.env

- domains and servers in domains.env are mapped 1:1
 - moved domains.env to ./files/domains.env
 - renamed kweb to web for a more generic approach
This commit is contained in:
2020-05-27 15:58:21 -04:00
parent 3d778ff698
commit f3d17e931a
8 changed files with 130 additions and 46 deletions

View File

@@ -9,7 +9,10 @@ services:
USER_UID: ${UID_PROXY:-12001}
GROUP_UID: ${UID_PROXY:-12001}
env_file:
- ./certbot/files/domains.env
# 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
@@ -17,7 +20,7 @@ services:
- "80:8080"
- "443:8443"
networks:
- service_kweb
- service_web
- service_certbot
volumes:
# cert volume
@@ -34,7 +37,12 @@ services:
USER_UID: ${UID_CERTBOT:-12002}
GROUP_UID: ${UID_PROXY:-12002}
env_file:
- ./certbot/files/domains.env
# 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
@@ -53,19 +61,19 @@ services:
# TODO: put this in its own docker-compose
# as the proxy does not require it
kweb:
web:
build:
context: ./kweb
context: ./web
args:
USER_UID: ${UID_KWEB:-12003}
GROUP_UID: ${UID_KWEB:-12003}
USER_UID: ${UID_WEB:-12003}
GROUP_UID: ${UID_WEB:-12003}
restart: always
image: kweb
container_name: kweb
image: web
container_name: web
networks:
- service_kweb
- service_web
volumes:
- service_kweb:/service/html:ro
- service_web:/service/html:ro
volumes:
# proxy volumes
@@ -83,11 +91,11 @@ volumes:
certbot_logs:
name: certbot_logs
# service volumes
service_kweb:
name: service_kweb
service_web:
name: service_web
networks:
service_kweb:
name: service_kweb
service_web:
name: service_web
service_certbot:
name: service_certbot