version: '3.8' services: matrix-postgres: image: postgres:13 container_name: matrix-postgres environment: POSTGRES_DB: synapse POSTGRES_USER: synapse POSTGRES_PASSWORD: {{ matrix_postgres_password }} POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=C --lc-ctype=C" volumes: - {{ matrix_postgres_dir }}:/var/lib/postgresql/data restart: always healthcheck: test: ["CMD-SHELL", "pg_isready -U synapse"] interval: 5s timeout: 5s retries: 5 matrix-synapse: image: matrixdotorg/synapse:latest container_name: matrix-synapse ports: - "{{ matrix_port }}:8008" volumes: - {{ matrix_data_dir }}:/data - {{ matrix_config_dir }}:/data - {{ matrix_media_dir }}:/data/media environment: SYNAPSE_CONFIG_PATH: /data/homeserver.yaml depends_on: matrix-postgres: condition: service_healthy restart: always healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8008/health"] interval: 15s timeout: 5s retries: 3