docker-compose.yml 608 B

1234567891011121314151617181920212223242526272829
  1. version: "3.7"
  2. networks:
  3. postgres-network:
  4. driver: bridge
  5. ipam:
  6. config:
  7. - subnet: ${POSTGRES_SUBNET}
  8. services:
  9. pg15:
  10. container_name: pg15
  11. build:
  12. context: ./postgres
  13. dockerfile: Dockerfile
  14. working_dir: /var/lib/postgres
  15. restart: unless-stopped
  16. ports:
  17. - "5432:5432"
  18. volumes:
  19. - ${POSTGRES_STORAGE_PATH}:/var/lib/postgresql/data
  20. - ${POSTGRES_LOG_PATH}:/var/log/postgresql
  21. networks:
  22. postgres-network:
  23. ipv4_address: ${POSTGRES_IP}
  24. environment:
  25. - POSTGRES_USER=postgres
  26. - POSTGRES_PASSWORD=postgres