pg_guard 0.1.4

A Postgres proxy with built-in safety features
services:
  postgres:
    image: postgres:15-alpine
    container_name: pg_guard-postgres
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_HOST_AUTH_METHOD: trust
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./migrations:/docker-entrypoint-initdb.d
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5

  pg_guard:
    build: .
    container_name: pg_guard-proxy
    depends_on:
      postgres:
        condition: service_healthy
    ports:
      - "6543:6543"
    environment:
      - RUST_LOG=info
    command: pg_guard --listen 0.0.0.0:6543 --db-url postgres://postgres:postgres@postgres:5432/postgres --max-rows 1
    restart: unless-stopped

  pgadmin:
    image: dpage/pgadmin4:latest
    container_name: pg_guard-pgadmin
    environment:
      PGADMIN_DEFAULT_EMAIL: admin@pg_guard.com
      PGADMIN_DEFAULT_PASSWORD: admin
      PGADMIN_CONFIG_SERVER_MODE: "False"
    ports:
      - "8080:80"
    depends_on:
      - postgres

volumes:
  postgres_data: