feat: proxying support

Part of https://git.coopcloud.tech/coop-cloud/matrix-synapse/issues/1.
This commit is contained in:
cellarspoon
2021-12-12 23:31:37 +01:00
parent a5f9105613
commit 650e0cbc28
4 changed files with 55 additions and 9 deletions

View File

@ -2,6 +2,28 @@
version: "3.8"
services:
web:
image: nginx:1.20.0
networks:
- proxy
- internal
environment:
- DOMAIN
- STACK_NAME
configs:
- source: nginx_config
target: /etc/nginx/nginx.conf
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=0.1.0+v1.48.0"
app:
image: "matrixdotorg/synapse:v1.48.0"
volumes:
@ -16,7 +38,7 @@ services:
- VIRTUAL_HOST=${DOMAIN}
- VIRTUAL_PORT=8008
networks:
- proxy
- internal
entrypoint: /docker-entrypoint.sh
configs:
- source: homeserver_yaml
@ -25,13 +47,6 @@ services:
target: /docker-entrypoint.sh
mode: 0555
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8008"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=0.1.0+v1.48.0"
restart_policy:
condition: on-failure
delay: "60s"
@ -73,6 +88,10 @@ configs:
name: ${STACK_NAME}_homserver_yaml_${HOMESERVER_YAML_VERSION}
file: homeserver.yaml.tmpl
template_driver: golang
nginx_config:
name: ${STACK_NAME}_nginx_config_${NGINX_CONFIG_VERSION}
file: nginx.conf.tmpl
template_driver: golang
secrets:
db_password: