services:
  postgres:
    image: postgres:16-alpine
    container_name: eee_dashboard_db
    restart: unless-stopped
    environment:
      POSTGRES_USER: ${DB_USER:-eee_admin}
      POSTGRES_PASSWORD: ${DB_PASSWORD:-eee_password}
      POSTGRES_DB: ${DB_NAME:-eee_dashboard}
    ports:
      - "${DB_PORT:-54320}:5432"
    volumes:
      - ./data/postgres:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-eee_admin} -d ${DB_NAME:-eee_dashboard}"]
      interval: 10s
      timeout: 5s
      retries: 5
