| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| container_name: sqldemo-postgres | |
| environment: | |
| POSTGRES_DB: warehouse | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| # Files here run once, on first boot of an empty data volume. | |
| - ./init:/docker-entrypoint-initdb.d:ro | |
| - pgdata:/var/lib/postgresql/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U postgres -d warehouse"] | |
| interval: 3s | |
| timeout: 3s | |
| retries: 20 | |
| volumes: | |
| pgdata: | |