docker-compose.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # This compose file is compatible with Compose itself, it might need some
  2. # adjustments to run properly with stack.
  3. version: '3'
  4. services:
  5. synapse:
  6. build:
  7. context: ../..
  8. dockerfile: docker/Dockerfile
  9. image: docker.io/matrixdotorg/synapse:latest
  10. # Since synapse does not retry to connect to the database, restart upon
  11. # failure
  12. restart: unless-stopped
  13. # See the readme for a full documentation of the environment settings
  14. environment:
  15. - SYNAPSE_CONFIG_PATH=/etc/homeserver.yaml
  16. volumes:
  17. # You may either store all the files in a local folder
  18. - ./matrix-config:/etc
  19. - ./files:/data
  20. # .. or you may split this between different storage points
  21. # - ./files:/data
  22. # - /path/to/ssd:/data/uploads
  23. # - /path/to/large_hdd:/data/media
  24. depends_on:
  25. - db
  26. # In order to expose Synapse, remove one of the following, you might for
  27. # instance expose the TLS port directly:
  28. ports:
  29. - 8448:8448/tcp
  30. # ... or use a reverse proxy, here is an example for traefik:
  31. labels:
  32. # The following lines are valid for Traefik version 1.x:
  33. - traefik.enable=true
  34. - traefik.frontend.rule=Host:my.matrix.Host
  35. - traefik.port=8008
  36. # Alternatively, for Traefik version 2.0:
  37. - traefik.enable=true
  38. - traefik.http.routers.http-synapse.entryPoints=http
  39. - traefik.http.routers.http-synapse.rule=Host(`my.matrix.host`)
  40. - traefik.http.middlewares.https_redirect.redirectscheme.scheme=https
  41. - traefik.http.middlewares.https_redirect.redirectscheme.permanent=true
  42. - traefik.http.routers.http-synapse.middlewares=https_redirect
  43. - traefik.http.routers.https-synapse.entryPoints=https
  44. - traefik.http.routers.https-synapse.rule=Host(`my.matrix.host`)
  45. - traefik.http.routers.https-synapse.service=synapse
  46. - traefik.http.routers.https-synapse.tls=true
  47. - traefik.http.services.synapse.loadbalancer.server.port=8008
  48. - traefik.http.routers.https-synapse.tls.certResolver=le-ssl
  49. db:
  50. image: docker.io/postgres:10-alpine
  51. # Change that password, of course!
  52. environment:
  53. - POSTGRES_USER=synapse
  54. - POSTGRES_PASSWORD=changeme
  55. volumes:
  56. # You may store the database tables in a local folder..
  57. - ./schemas:/var/lib/postgresql/data
  58. # .. or store them on some high performance storage for better results
  59. # - /path/to/ssd/storage:/var/lib/postgresql/data