| # docker-compose.yml | |
| version: "3.8" | |
| services: | |
| postgres: | |
| image: postgres:15-alpine | |
| container_name: invoice_db | |
| environment: | |
| POSTGRES_USER: ${POSTGRES_USER:-user} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} | |
| POSTGRES_DB: ${POSTGRES_DB:-invoices_db} | |
| ports: | |
| - "5433:5432" | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U user -d invoices_db"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| volumes: | |
| postgres_data: | |