# version: "3.8"
services:
  pgadmin:
    image: dpage/pgadmin4
    container_name: pgadmin4_container
    restart: always
    ports:
      - 5050:80
    environment:
      PGADMIN_DEFAULT_EMAIL: ${DEFAULT_EMAIL}
      PGADMIN_DEFAULT_PASSWORD: ${DEFAULT_PASSWORD}
    volumes:
      - pgadmin-data:/var/lib/pgadmin
    labels:
      - homepage.group=Apps
      - homepage.name=PGAdmin
      - homepage.icon=mdi-database
      - homepage.description=pgsql Manager (esh)
      - homepage.href=http://10.0.50.45:5050
    networks:
      - tnet
    env_file:
      - .env
  backup:
    image: offen/docker-volume-backup:latest
    restart: always
    volumes:
      # volumes to backup.
      - pgadmin-data:/backup/pgadmin-data:ro
      - /mnt/backup/docker/esh-vm-docker/pgadmin:/archive
      # can omit below if not stopping service.
      # - /var/run/docker.sock:/var/run/docker.sock:ro
    env_file:
      - .env
networks:
  tnet:
    name: traefik-net
    external: true
volumes:
  pgadmin-data: null
