services:
  pgadmin:
    image: dpage/pgadmin4:latest
    container_name: pgadmin
    restart: unless-stopped

    environment:
      PGADMIN_DEFAULT_EMAIL: admin@example.com
      PGADMIN_DEFAULT_PASSWORD: ChangeMe123!
      PGADMIN_CONFIG_SERVER_MODE: "True"

    ports:
      - "8080:80"

    volumes:
      - pgadmin_data:/var/lib/pgadmin

    healthcheck:
      test: ["CMD", "wget", "--spider", "-q", "http://localhost/misc/ping"]
      interval: 30s
      timeout: 10s
      retries: 3

volumes:
  pgadmin_data: