ansible-role-docker_synapse/templates/docker-compose.yml
2022-08-15 14:33:26 +02:00

49 lines
1.5 KiB
YAML

# {{ ansible_managed }}
version: '3.1'
services:
synapse:
image: matrixdotorg/synapse:{{ docker_synapse_version }}
volumes:
- {{ docker_synapse_data_dir }}/{{ docker_synapse_service_id }}/synapse_data:/data
{% if docker_synapse_gen_config is false %}
- ./homeserver.yaml:/data/homeserver.yaml
{% endif %}
restart: always
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.{{ docker_synapse_service_id }}.entrypoints=web"
- "traefik.http.routers.{{ docker_synapse_service_id }}.rule=Host(`{{ docker_synapse_fqdn }}`)"
- "traefik.http.services.{{ docker_synapse_service_id }}.loadbalancer.server.port=8008"
networks:
- synapse
- traefik
environment:
- SYNAPSE_SERVER_NAME={{ docker_synapse_server_name }}
- SYNAPSE_REPORT_STATS={{ docker_synapse_report_stats }}
db:
restart: always
image: postgres:14
shm_size: 256mb
networks:
- synapse
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
volumes:
- {{ docker_synapse_data_dir }}/{{ docker_synapse_service_id }}/db_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: "{{ docker_synapse_db_name }}"
POSTGRES_USER: "{{ docker_synapse_db_user }}"
POSTGRES_PASSWORD: "{{ docker_synapse_db_password }}"
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
networks:
traefik:
external: true
synapse:
internal: true