Postgres
docker-compose.yml
services:
postgres:
image: postgres:17.6-alpine
restart: unless-stopped
container_name: postgres
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pass
- POSTGRES_DB=database
ports:
- 5432:5432
volumes:
- ./postgres-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
networks:
default:
external: true
name: example-net