docker-compose.yml 940 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. services:
  2. postgres:
  3. image: postgis/postgis:16-3.4
  4. container_name: postgres_simple
  5. restart: unless-stopped
  6. ports:
  7. - "0.0.0.0:5432:5432"
  8. environment:
  9. - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_root_password
  10. volumes:
  11. - postgres_simple_data:/var/lib/postgresql/data
  12. - /etc/localtime:/etc/localtime
  13. - /var/backups/postgres:/backups
  14. secrets:
  15. - postgres_root_password
  16. networks:
  17. - default
  18. - db-migration
  19. healthcheck:
  20. test: ["CMD", "pg_isready", "-U", "postgres"]
  21. interval: 10s
  22. timeout: 5s
  23. retries: 5
  24. logging:
  25. driver: "json-file"
  26. options:
  27. max-size: "10m"
  28. max-file: "3"
  29. volumes:
  30. postgres_simple_data:
  31. name: postgres_simple_data
  32. secrets:
  33. postgres_root_password:
  34. file: .secrets/postgres_root_password
  35. networks:
  36. default:
  37. name: postgres_simple_default
  38. db-migration:
  39. external: true