docker-compose.yaml 412 B

123456789101112131415161718
  1. ---
  2. services:
  3. postgres:
  4. image: postgres:16.2
  5. container_name: postgres
  6. environment:
  7. - POSTGRES_USER=${POSTGRES_USER}
  8. - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
  9. # (Optional) when creating a new database
  10. # - POSTGRES_DB=${POSTGRES_DB}
  11. ports:
  12. - 5432:5432
  13. volumes:
  14. - postgres-data:/var/lib/postgresql/data
  15. restart: unless-stopped
  16. volumes:
  17. postgres-data: