{"id":18330946,"url":"https://github.com/dataquestio/pgbouncer-docker","last_synced_at":"2025-04-09T18:10:50.431Z","repository":{"id":146402168,"uuid":"144801232","full_name":"dataquestio/pgbouncer-docker","owner":"dataquestio","description":"A docker container running a configurable pgbouncer","archived":false,"fork":false,"pushed_at":"2018-08-15T04:56:17.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-15T10:46:22.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dataquestio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-15T03:27:32.000Z","updated_at":"2020-10-22T23:53:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"0854844c-4179-4b77-a8fe-b89256307045","html_url":"https://github.com/dataquestio/pgbouncer-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataquestio%2Fpgbouncer-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataquestio%2Fpgbouncer-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataquestio%2Fpgbouncer-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataquestio%2Fpgbouncer-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dataquestio","download_url":"https://codeload.github.com/dataquestio/pgbouncer-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085184,"owners_count":21045137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T19:27:19.172Z","updated_at":"2025-04-09T18:10:50.413Z","avatar_url":"https://github.com/dataquestio.png","language":"Shell","readme":"# pgbouncer-docker\n\nA docker container running a configurable pgbouncer. Optimized for running Kubernetes on GKE with Cloud SQL Postgres.\n\nDockerhub: [https://hub.docker.com/r/handshake/pgbouncer/](https://hub.docker.com/r/handshake/pgbouncer/)\n\n## Configuration\n\n### DB_USER\n\nThe database username\n\n### DB_PASSWORD\n\nThe database password\n\n### DB_HOST\n\nThe IP or host of the database. If using cloud sql proxy, this will most likely be `127.0.0.1`.\n\n### DB_PORT\n\nThe IP or host of the database. If using cloud sql proxy, this will most likely be `5432`, or the port you pass into the Cloud SQL command args.\n\n## Usage in GKE\n\nTo use with GKE, run this container alongside the `cloudsql-docker/gce-proxy`. Your configuration might look something like below\n\n```\n---\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: pgbouncer-configs\ndata:\n  DB_HOST: \"127.0.0.1\"\n  DB_PORT: \"5432\"\n---\napiVersion: extensions/v1beta1\nkind: Deployment\nmetadata:\n  name: pgbouncer\n  labels:\n    tier: database\nspec:\n  replicas: 1\n  minReadySeconds: 20\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxSurge: 1\n      maxUnavailable: 1\n  template:\n    metadata:\n      labels:\n        tier: database\n    spec:\n      containers:\n        - image: handshake/pgbouncer:0.1.2\n          name: pgbouncer\n          ports:\n            - containerPort: 6432\n              protocol: TCP\n          envFrom:\n            - configMapRef:\n                name: pgbouncer-configs\n          readinessProbe:\n            tcpSocket:\n              port: 6432\n            initialDelaySeconds: 5\n            periodSeconds: 10\n          livenessProbe:\n            tcpSocket:\n              port: 6432\n            initialDelaySeconds: 15\n            periodSeconds: 20\n          resources:\n            requests:\n              cpu: 100m\n              memory: 300m\n        - image: gcr.io/cloudsql-docker/gce-proxy:1.11    # Gcloud SQL Proxy\n          name: cloudsql-proxy\n          command:\n            - /cloud_sql_proxy\n            - --dir=/cloudsql\n            - -instances=$(DATABASE_INSTANCE_NAMES)\n            - -credential_file=/secrets/cloudsql_credentials.json\n          ports:\n            - containerPort: 5432\n              protocol: TCP\n          volumeMounts:\n            - name: cloudsql-credentials\n              mountPath: /secrets/cloudsql\n              readOnly: true\n            - name: cloudsql\n              mountPath: /cloudsql\n      volumes:\n        - name: cloudsql-credentials\n          secret:\n            secretName: cloudsql-credentials\n        - name: cloudsql\n          emptyDir:\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: pgbouncer-service\nspec:\n  type: NodePort\n  ports:\n  - name: pgbouncer-service-port\n    protocol: TCP\n    port: 6432\n    targetPort: 6432\n    nodePort: 0\n  selector:\n    tier: database\n```\n\n## Inspiration\n\nThis container takes inspiration from [https://github.com/heroku/heroku-buildpack-pgbouncer](https://github.com/heroku/heroku-buildpack-pgbouncer) and [https://github.com/guizmaii/pgbouncer](https://github.com/guizmaii/pgbouncer). Thanks to both!","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataquestio%2Fpgbouncer-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdataquestio%2Fpgbouncer-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataquestio%2Fpgbouncer-docker/lists"}