Snippet content copied to clipboard.
Are you sure to delete this snippet? No, don't delete
  1. version: "3.4"
  2. services:
  3. synapse:
  4. hostname: matrix
  5. image: matrixdotorg/synapse:latest
  6. restart: always
  7. container_name: matrix_server
  8. depends_on:
  9. - db
  10. - redis
  11. ports:
  12. - "127.0.0.1:8001:8008"
  13. volumes:
  14. - ./synapse/data:/data
  15. networks:
  16. - synapse_network
  17. - external_network
  18. healthcheck:
  19. test: ["CMD-SHELL", "curl -s localhost:8008/health || exit 1"]
  20. db:
  21. image: postgres
  22. restart: always
  23. container_name: matrix_db
  24. volumes:
  25. - ./synapse/db:/var/lib/postgresql/data
  26. environment:
  27. POSTGRES_USER: synapse
  28. POSTGRES_PASSWORD: ****REPLACE HERE WITH YOUR PASSWORD, THIS DATABASE IS ONLY FOR INTERNAL USE.****
  29. POSTGRES_DB: synapse
  30. POSTGRES_INITDB_ARGS: "--encoding='UTF8' --lc-collate='C' --lc-ctype='C'"
  31. networks:
  32. - synapse_network
  33. healthcheck:
  34. test: ["CMD", "pg_isready", "-U", "synapse"]
  35. redis:
  36. image: redis:6.0-alpine
  37. restart: always
  38. container_name: matrix_redis
  39. volumes:
  40. - ./synapse/redis:/data
  41. networks:
  42. - synapse_network
  43. healthcheck:
  44. test: ["CMD", "redis-cli", "ping"]
  45. networks:
  46. synapse_network:
  47. internal: true
  48. external_network:

Edit this Snippet