1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| version: "3.4"
services: synapse: hostname: matrix image: matrixdotorg/synapse:latest restart: always container_name: matrix_server depends_on: - db - redis ports: - "127.0.0.1:8001:8008" volumes: - ./synapse/data:/data networks: - synapse_network - external_network healthcheck: test: ["CMD-SHELL", "curl -s localhost:8008/health || exit 1"]
db: image: postgres restart: always container_name: matrix_db volumes: - ./synapse/db:/var/lib/postgresql/data environment: POSTGRES_USER: synapse POSTGRES_PASSWORD: 随便什么密码 POSTGRES_DB: synapse POSTGRES_INITDB_ARGS: "--encoding='UTF8' --lc-collate='C' --lc-ctype='C'" networks: - synapse_network healthcheck: test: ["CMD", "pg_isready", "-U", "synapse"]
redis: image: redis:6.0-alpine restart: always container_name: matrix_redis volumes: - ./synapse/redis:/data networks: - synapse_network healthcheck: test: ["CMD", "redis-cli", "ping"]
networks: synapse_network: internal: true external_network:
|