docker-compose.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. networks:
  2. backend:
  3. services:
  4. postgres:
  5. image: postgres:latest
  6. restart: unless-stopped
  7. volumes:
  8. - ${VOLUME_PATH}/var/lib/postgresql/data:/var/lib/postgresql/data:rw
  9. networks:
  10. - backend
  11. environment:
  12. POSTGRES_DB: synapse
  13. POSTGRES_USER: synapse_user
  14. POSTGRES_PASSWORD: postgres
  15. POSTGRES_INITDB_ARGS: --encoding=UTF8 --locale=C
  16. redis:
  17. image: redis:latest
  18. restart: unless-stopped
  19. networks:
  20. - backend
  21. synapse:
  22. image: matrixdotorg/synapse:latest
  23. container_name: synapse
  24. restart: unless-stopped
  25. volumes:
  26. - ${VOLUME_PATH}/data:/data:rw
  27. ports:
  28. - 8008:8008
  29. networks:
  30. - backend
  31. environment:
  32. SYNAPSE_CONFIG_DIR: /data
  33. SYNAPSE_CONFIG_PATH: /data/homeserver.yaml
  34. depends_on:
  35. - postgres
  36. synapse-generic-worker-1:
  37. image: matrixdotorg/synapse:latest
  38. container_name: synapse-generic-worker-1
  39. restart: unless-stopped
  40. entrypoint: ["/start.py", "run", "--config-path=/data/homeserver.yaml", "--config-path=/data/workers/synapse-generic-worker-1.yaml"]
  41. healthcheck:
  42. test: ["CMD-SHELL", "curl -fSs http://localhost:8081/health || exit 1"]
  43. start_period: "5s"
  44. interval: "15s"
  45. timeout: "5s"
  46. networks:
  47. - backend
  48. volumes:
  49. - ${VOLUME_PATH}/data:/data:rw # Replace VOLUME_PATH with the path to your Synapse volume
  50. environment:
  51. SYNAPSE_WORKER: synapse.app.generic_worker
  52. # Expose port if required so your reverse proxy can send requests to this worker
  53. # Port configuration will depend on how the http listener is defined in the worker configuration file
  54. ports:
  55. - 8081:8081
  56. depends_on:
  57. - synapse
  58. synapse-federation-sender-1:
  59. image: matrixdotorg/synapse:latest
  60. container_name: synapse-federation-sender-1
  61. restart: unless-stopped
  62. entrypoint: ["/start.py", "run", "--config-path=/data/homeserver.yaml", "--config-path=/data/workers/synapse-federation-sender-1.yaml"]
  63. healthcheck:
  64. disable: true
  65. networks:
  66. - backend
  67. volumes:
  68. - ${VOLUME_PATH}/data:/data:rw # Replace VOLUME_PATH with the path to your Synapse volume
  69. environment:
  70. SYNAPSE_WORKER: synapse.app.federation_sender
  71. depends_on:
  72. - synapse