Run
docker run -p 54280:54280 ghcr.io/hxndrik/pgquery
Open http://localhost:54280. Images are published for amd64 and arm64.
Docker Compose
services:
pgquery:
image: ghcr.io/hxndrik/pgquery
ports:
- "54280:54280"
environment:
RATE_LIMIT_RPM: 120
restart: unless-stopped
Settings
PORT: listen port, default 54280.RATE_LIMIT_RPM: requests per minute per client IP.MAX_QUERY_TIMEOUTandMAX_ROWS: limits per query.MAX_UPLOAD_MB: largest file the S3 browser uploads, default 100.DEMO_DATABASE_URL: run a public demo. pgquery seeds a sample database, serves it read-only and resets it daily (DEMO_RESET_INTERVAL). Instances with a demo also refuse private and local addresses.DEMO_S3_ENDPOINT,DEMO_S3_ACCESS_KEY,DEMO_S3_SECRET_KEY: the same for a sample bucket. Give it a dedicated bucket (DEMO_S3_BUCKET): the seed removes everything that is not part of the sample.
Security notes
pgquery has no login of its own. Anyone who can reach it can use it to connect to databases they have credentials for. Put it behind your VPN, an authenticating reverse proxy (oauth2-proxy, Authelia, Cloudflare Access) or bind it to localhost.
Source: github.com/Hxndrik/pgquery