Files
pgadmin/docker-compose.yml
primal 14c73b60fc Switch pgadmin to infra network
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:38:31 -05:00

46 lines
1.5 KiB
YAML

services:
pgadmin:
image: dpage/pgadmin4:latest
container_name: infra-pgadmin
restart: unless-stopped
environment:
PGADMIN_DEFAULT_EMAIL: primal.host@primal.host
PGADMIN_DEFAULT_PASSWORD_FILE: /run/secrets/pgadmin_password
PGADMIN_CONFIG_PROXY_X_FOR_COUNT: 1
PGADMIN_CONFIG_PROXY_X_PROTO_COUNT: 1
secrets:
- pgadmin_password
volumes:
- pgadmin_data:/var/lib/pgadmin
- ./servers.json:/pgadmin4/servers.json:ro
- ./pgpass:/pgadmin4/pgpass:ro
networks:
- infra
labels:
- "traefik.enable=true"
# Production route: pgadmin.primal.host
- "traefik.http.routers.pgadmin.rule=Host(`pgadmin.primal.host`)"
- "traefik.http.routers.pgadmin.entrypoints=https"
- "traefik.http.routers.pgadmin.tls.certresolver=letsencrypt"
- "traefik.http.routers.pgadmin.service=pgadmin"
- "traefik.http.services.pgadmin.loadbalancer.server.port=80"
# HTTP to HTTPS redirect
- "traefik.http.routers.pgadmin-redirect.rule=Host(`pgadmin.primal.host`)"
- "traefik.http.routers.pgadmin-redirect.entrypoints=http"
- "traefik.http.routers.pgadmin-redirect.middlewares=https-redirect"
# Local development route
- "traefik.http.routers.pgadmin-local.rule=Host(`pgadmin.primal.localhost`)"
- "traefik.http.routers.pgadmin-local.entrypoints=http"
- "traefik.http.routers.pgadmin-local.service=pgadmin"
secrets:
pgadmin_password:
file: ./pgadmin_password.txt
volumes:
pgadmin_data:
networks:
infra:
external: true