pq Docker & Self-Hosted Deployment

GitHub

Go PostgreSQL driver for database/sql

9,879 stars Go Go 1 file ยท ~2,528 tokens
RAW Compose
1. Pull Image (DOCKERHUB) docker pull cleanstart/pgbouncer
2. Docker Run (1-Click Launch) docker run -d --name pq -p 6432:6432 --restart always cleanstart/pgbouncer:latest
3. Podman Run podman run -d --name pq -p 6432:6432 --restart always cleanstart/pgbouncer:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/cleanstart/pgbouncer:latest
5. ORAS Pull (OCI Artifact) oras pull cleanstart/pgbouncer:latest
6. Compose Deployment docker compose up -d
compose.yaml
Download .yml
name: 'pqgo'

services:
  pgbouncer:
    profiles: ['pgbouncer']
    image:    'cleanstart/pgbouncer:latest'
    ports:    ['127.0.0.1:6432:6432']
    command:  ['/init/pgbouncer.ini']
    volumes:  ['./testdata/pgbouncer:/init', './testdata/ssl:/ssl']
    environment:
      'PGBOUNCER_DATABASE': 'pqgo'

  pgpool:
    profiles:   ['pgpool']
    image:      'pgpool/pgpool:4.4.3'
    ports:      ['127.0.0.1:7432:7432']
    volumes:    ['./testdata/pgpool:/init', './testdata/ssl:/ssl']
    entrypoint: '/init/entry.sh'
    environment:
      'PGPOOL_PARAMS_PORT':              '7432'
      'PGPOOL_PARAMS_BACKEND_HOSTNAME0': 'pg18'

  cockroach:
    profiles:    ['cockroach']
    image:       'cockroachdb/cockroach:latest-v26.1'
    ports:       ['127.0.0.1:26257:26257']
    volumes:     ['./testdata/cockroach:/docker-entrypoint-initdb.d', './testdata/ssl:/ssl']
    command:     ['start-single-node', '--accept-sql-without-tls', '--certs-dir=/ssl2']
    healthcheck: {test: ['CMD-SHELL', '/cockroach/cockroach node status --insecure --user=pqgo'], start_period: '30s', start_interval: '1s'}

  pg19:
    profiles:    ['pg19']
    image:       'postgres:19beta3'
    ports:       ['127.0.0.1:5432:5432']
    entrypoint:  '/init/entry.sh'
    volumes:     ['./testdata/postgres:/init', './testdata/ssl:/ssl']
    shm_size:    '128mb'
    healthcheck: {test: ['CMD-SHELL', 'pg_isready -U pqgo -d pqgo'], start_period: '30s', start_interval: '1s'}
    environment:
      'POSTGRES_DATABASE': 'pqgo'
      'POSTGRES_USER':     'pqgo'
      'POSTGRES_PASSWORD': 'unused'
  pg18:
    image:       'postgres:18'
    ports:       ['127.0.0.1:5432:5432']
    entrypoint:  '/init/entry.sh'
    volumes:     ['./testdata/postgres:/init', './testdata/ssl:/ssl']
    shm_size:    '128mb'
    healthcheck: {test: ['CMD-SHELL', 'pg_isready -U pqgo -d pqgo'], start_period: '30s', start_interval: '1s'}
    environment:
      'POSTGRES_DATABASE': 'pqgo'
      'POSTGRES_USER':     'pqgo'
      'POSTGRES_PASSWORD': 'unused'
  pg17:
    profiles:    ['pg17']
    image:       'postgres:17'
    ports:       ['127.0.0.1:5432:5432']
    entrypoint:  '/init/entry.sh'
    volumes:     ['./testdata/postgres:/init', './testdata/ssl:/ssl']
    shm_size:    '128mb'
    healthcheck: {test: ['CMD-SHELL', 'pg_isready -U pqgo -d pqgo'], start_period: '30s', start_interval: '1s'}
    environment:
      'POSTGRES_DATABASE': 'pqgo'
      'POSTGRES_USER':     'pqgo'
      'POSTGRES_PASSWORD': 'unused'
  pg16:
    profiles:    ['pg16']
    image:       'postgres:16'
    ports:       ['127.0.0.1:5432:5432']
    entrypoint:  '/init/entry.sh'
    volumes:     ['./testdata/postgres:/init', './testdata/ssl:/ssl']
    shm_size:    '128mb'
    healthcheck: {test: ['CMD-SHELL', 'pg_isready -U pqgo -d pqgo'], start_period: '30s', start_interval: '1s'}
    environment:
      'POSTGRES_DATABASE': 'pqgo'
      'POSTGRES_USER':     'pqgo'
      'POSTGRES_PASSWORD': 'unused'
  pg15:
    profiles:    ['pg15']
    image:       'postgres:15'
    ports:       ['127.0.0.1:5432:5432']
    entrypoint:  '/init/entry.sh'
    volumes:     ['./testdata/postgres:/init', './testdata/ssl:/ssl']
    shm_size:    '128mb'
    healthcheck: {test: ['CMD-SHELL', 'pg_isready -U pqgo -d pqgo'], start_period: '30s', start_interval: '1s'}
    environment:
      'POSTGRES_DATABASE': 'pqgo'
      'POSTGRES_USER':     'pqgo'
      'POSTGRES_PASSWORD': 'unused'
  pg14:
    profiles:    ['pg14']
    image:       'postgres:14'
    ports:       ['127.0.0.1:5432:5432']
    entrypoint:  '/init/entry.sh'
    volumes:     ['./testdata/postgres:/init', './testdata/ssl:/ssl']
    shm_size:    '128mb'
    healthcheck: {test: ['CMD-SHELL', 'pg_isready -U pqgo -d pqgo'], start_period: '30s', start_interval: '1s'}
    environment:
      'POSTGRES_DATABASE': 'pqgo'
      'POSTGRES_USER':     'pqgo'
      'POSTGRES_PASSWORD': 'unused'