Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using pgbouncer in monorepos #153

Open
buckmaxwell opened this issue Oct 7, 2021 · 0 comments
Open

Using pgbouncer in monorepos #153

buckmaxwell opened this issue Oct 7, 2021 · 0 comments

Comments

@buckmaxwell
Copy link

I apologize if I am being obtuse - but is there a preferred way of using this in a monorepo context? Help greatly appreciated.

My server is Daphne and my executable is in a directory called api. I understand I need to prefix the server start command with the pgbouncer command.

Starting point.

web: sh -c 'cd api && python3 manage.py collectstatic --noinput && daphne myapp.asgi:application --port $PORT --bind 0.0.0.0'

I can't call manage.py from the top level or it blows up. I also can't call ../bin/start-pgbouncer from within api because that script calls other scripts via relative path (and assumes they will exist at the top level).

I haven't delved into why the bin/start-pgbouncer executatble needs to be pre-prepended to the start server command but I assume I can't just slap it onto the end like,

web: sh -c 'cd api && python3 manage.py collectstatic --noinput && daphne myapp.asgi:application --port $PORT --bind 0.0.0.0' && bin/start-pgbouncer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant