compose.yaml 884 B

12345678910111213141516171819202122232425
  1. services:
  2. ###> doctrine/doctrine-bundle ###
  3. database:
  4. image: postgres:${POSTGRES_VERSION:-16}-alpine
  5. environment:
  6. POSTGRES_DB: ${POSTGRES_DB:-app}
  7. # You should definitely change the password in production
  8. POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
  9. POSTGRES_USER: ${POSTGRES_USER:-app}
  10. healthcheck:
  11. test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
  12. timeout: 5s
  13. retries: 5
  14. start_period: 60s
  15. volumes:
  16. - database_data:/var/lib/postgresql/data:rw
  17. # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
  18. # - ./docker/db/data:/var/lib/postgresql/data:rw
  19. ###< doctrine/doctrine-bundle ###
  20. volumes:
  21. ###> doctrine/doctrine-bundle ###
  22. database_data:
  23. ###< doctrine/doctrine-bundle ###