docker-compose.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. version: '3'
  2. services:
  3. ###> doctrine/doctrine-bundle ###
  4. database:
  5. image: postgres:${POSTGRES_VERSION:-15}-alpine
  6. environment:
  7. POSTGRES_DB: ${POSTGRES_DB:-app}
  8. # You should definitely change the password in production
  9. POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
  10. POSTGRES_USER: ${POSTGRES_USER:-app}
  11. volumes:
  12. - database_data:/var/lib/postgresql/data:rw
  13. # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
  14. # - ./docker/db/data:/var/lib/postgresql/data:rw
  15. ###< doctrine/doctrine-bundle ###
  16. ###> symfony/mercure-bundle ###
  17. mercure:
  18. image: dunglas/mercure
  19. restart: unless-stopped
  20. environment:
  21. SERVER_NAME: ':80'
  22. MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
  23. MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
  24. # Set the URL of your Symfony project (without trailing slash!) as value of the cors_origins directive
  25. MERCURE_EXTRA_DIRECTIVES: |
  26. cors_origins http://127.0.0.1:8000
  27. # Comment the following line to disable the development mode
  28. command: /usr/bin/caddy run --config /etc/caddy/Caddyfile.dev
  29. volumes:
  30. - mercure_data:/data
  31. - mercure_config:/config
  32. ###< symfony/mercure-bundle ###
  33. volumes:
  34. ###> doctrine/doctrine-bundle ###
  35. database_data:
  36. ###< doctrine/doctrine-bundle ###
  37. ###> symfony/mercure-bundle ###
  38. mercure_data:
  39. mercure_config:
  40. ###< symfony/mercure-bundle ###