secrets:
  pgadmin_default_password:
    file: ${DB_PATH}/pgadmin/secrets/default_password.txt
services:
  pgAdmin:
    extends:
      file: ${TEMPLATES_PATH}
      service: default
    container_name: pgadmin
    image: dpage/pgadmin4:9.14.0
    ports:
      - 8082:80
    networks:
      - ip4net
    secrets: [pgadmin_default_password]
    volumes:
      - ${DB_PATH}/pgadmin/data:/var/lib/pgadmin
    environment:
      PGADMIN_DEFAULT_EMAIL: ${EMAIL}
      PGADMIN_DEFAULT_PASSWORD_FILE: /run/secrets/pgadmin_default_password
    labels:
      # Traefik
      - "traefik.enable=true"
      - "traefik.http.routers.pgadmin.rule=Host(`pgadmin.${LOCAL_DOMAIN}`)"
      - "traefik.http.routers.pgadmin.entrypoints=https"
      - "traefik.http.routers.pgadmin.tls=true"
