Skip to content

Using pgbouncer in monorepos #153

@buckmaxwell

Description

@buckmaxwell

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions