Files

69 lines
1.4 KiB
YAML

networks:
caddy:
name: caddy
driver: bridge
external: true
matrix:
name: matrix
driver: bridge
services:
synapse:
image: ghcr.io/element-hq/synapse:latest
restart: unless-stopped
container_name: synapse
labels:
- "com.centurylinklabs.watchtower.enable=true"
environment:
UID: 1000
GID: 100
SYNAPSE_CONFIG_DIR: /data
SYNAPSE_CONFIG_PATH: /data/homeserver.yaml
volumes:
- ./data/synapse:/data
networks:
- caddy
- matrix
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "1.0"
memory: 1G
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
db:
image: postgres:16-alpine
restart: unless-stopped
container_name: synapse-db
environment:
POSTGRES_USER: synapse
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: synapse
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C"
volumes:
- ./data/postgres:/var/lib/postgresql/data
networks:
- matrix
healthcheck:
test: ["CMD-SHELL", "pg_isready -U synapse"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.5"
memory: 400M
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"