work-hub-server/docker-compose.yml

23 lines
606 B
YAML

services:
postgres:
image: postgres:16-alpine
container_name: work-hub-postgres
restart: unless-stopped
ports:
- "${POSTGRES_PORT:-5432}:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-work_hub}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-work_hub}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data:
driver: local