services: matrix-synapse: image: docker.io/matrixdotorg/synapse:latest container_name: matrix-synapse restart: unless-stopped volumes: - ./data:/data environment: - SYNAPSE_CONFIG_PATH=/data/homeserver.yaml depends_on: - matrix-db deploy: resources: limits: cpus: '1.0' memory: 512M reservations: memory: 256M networks: - matrix_network matrix-db: image: docker.io/postgres:14-alpine container_name: matrix-db restart: unless-stopped environment: - POSTGRES_USER=${MATRIX_DB_USER:?} - POSTGRES_PASSWORD=${MATRIX_DB_PASSWORD:?} - POSTGRES_DB=${MATRIX_DB:?} - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C volumes: - ./db:/var/lib/postgresql/data deploy: resources: limits: cpus: '1.0' memory: 512M reservations: memory: 256M networks: - matrix_network matrix-element: image: vectorim/element-web:latest container_name: matrix-element restart: unless-stopped deploy: resources: limits: cpus: '1.0' memory: 256M reservations: memory: 128M networks: - matrix_network networks: matrix_network: name: matrix_network driver: bridge