Git Product home page Git Product logo

pgbouncerhero-demo's Introduction

PgBouncerHero-Demo

This is the demo app running on https://pgbouncerhero-demo.herokuapp.com (Heroku killed it by removing the free plan sorry!) demonstrating the usage of pgbouncerhero.

Installation

One PgBouncer

export PGBOUNCERHERO_DATABASE_URL=postgres://user:password@host:port/pgbouncer

Multiple PgBouncers

Create config/pgbouncerhero.yml with:

default: &default
  pgbouncers:
    production:
      master:
        url: <%= ENV["PGBOUNCER_MASTER_DATABASE_URL"] %>
      slave:
        url: <%= ENV["PGBOUNCER_SLAVE_DATABASE_URL"] %>

development:
  <<: *default

production:
  <<: *default

Heroku

This demo app is using following buildpacks:

# You need to fork your own to set the allow your database username to access pgbouncer database.
heroku buildpacks:add https://github.com/kwent/heroku-buildpack-pgbouncer
# Regular ruby buildpack
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-ruby

and config:

heroku config:set PGBOUNCER_PREPARED_STATEMENTS=false
heroku config:set PGBOUNCERHERO_DATABASE_URL=postgres://user:[email protected]:6000/pgbouncer

Authors

License

Copyright (c) 2017 Quentin Rousseau <[email protected]>

MIT License

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

pgbouncerhero-demo's People

Contributors

dependabot[bot] avatar kwent avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pgbouncerhero-demo's Issues

Dockerfile build is failing

# docker build -t pgbouncerhero .

Sending build context to Docker daemon    254kB
Step 1/15 : FROM ruby:2.3.7
2.3.7: Pulling from library/ruby
bc9ab73e5b14: Pull complete 
193a6306c92a: Pull complete 
e5c3f8c317dc: Pull complete 
a587a86c9dcb: Pull complete 
72744d0a318b: Pull complete 
31d57ef7a684: Pull complete 
0d13d6d5ad30: Pull complete 
a1ebc7601f5a: Pull complete 
Digest: sha256:2b3f3291cd7a922129dd7c60af2abf72446ab35f0b39308d349ca42856cd2752
Status: Downloaded newer image for ruby:2.3.7
 ---> 205d0fa463d7
Step 2/15 : MAINTAINER Quentin Rousseau <[email protected]>
 ---> Running in 39464f0efcdf
Removing intermediate container 39464f0efcdf
 ---> 18ad85974dcd
Step 3/15 : RUN apt-get update && apt-get install -qq -y --no-install-recommends   build-essential nodejs libpq-dev
 ---> Running in 2b29456d22fe
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [3177 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [710 kB]
Get:7 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Fetched 8058 kB in 2s (3126 kB/s)
Reading package lists...
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package dpkg-dev.
(Reading database ... 29290 files and directories currently installed.)
Preparing to unpack .../0-dpkg-dev_1.18.25_all.deb ...
Unpacking dpkg-dev (1.18.25) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../1-build-essential_12.3_amd64.deb ...
Unpacking build-essential (12.3) ...
Preparing to unpack .../2-libpq-dev_9.6.23-0+deb9u1_amd64.deb ...
Unpacking libpq-dev (9.6.23-0+deb9u1) over (9.6.10-0+deb9u1) ...
Preparing to unpack .../3-libpq5_9.6.23-0+deb9u1_amd64.deb ...
Unpacking libpq5:amd64 (9.6.23-0+deb9u1) over (9.6.10-0+deb9u1) ...
Selecting previously unselected package libuv1:amd64.
Preparing to unpack .../4-libuv1_1.9.1-3_amd64.deb ...
Unpacking libuv1:amd64 (1.9.1-3) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../5-nodejs_4.8.2~dfsg-1_amd64.deb ...
Unpacking nodejs (4.8.2~dfsg-1) ...
Setting up libuv1:amd64 (1.9.1-3) ...
Setting up dpkg-dev (1.18.25) ...
Setting up libpq5:amd64 (9.6.23-0+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up libpq-dev (9.6.23-0+deb9u1) ...
Setting up nodejs (4.8.2~dfsg-1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Setting up build-essential (12.3) ...
Removing intermediate container 2b29456d22fe
 ---> 486776faf383
Step 4/15 : ENV INSTALL_PATH /app
 ---> Running in a97442331576
Removing intermediate container a97442331576
 ---> 149552609fd7
Step 5/15 : ENV RAILS_ENV production
 ---> Running in edf796b87721
Removing intermediate container edf796b87721
 ---> f981f143c749
Step 6/15 : ENV PGBOUNCER_DATABASE_URL postgresql://user:[email protected]/dbname
 ---> Running in 765787fa8e69
Removing intermediate container 765787fa8e69
 ---> 7132d547ebc1
Step 7/15 : RUN mkdir -p $INSTALL_PATH
 ---> Running in 25bd3bd242fa
Removing intermediate container 25bd3bd242fa
 ---> 803b237f40f6
Step 8/15 : WORKDIR $INSTALL_PATH
 ---> Running in 96b7f9ed119b
Removing intermediate container 96b7f9ed119b
 ---> 714bb0aae309
Step 9/15 : COPY Gemfile Gemfile.lock ./
 ---> fcdaac4dca5c
Step 10/15 : RUN bundle install --binstubs
 ---> Running in 6f9c540a5a72
You must use Bundler 2 or greater with this lockfile.
The command '/bin/sh -c bundle install --binstubs' returned a non-zero code: 20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.