ralph icon indicating copy to clipboard operation
ralph copied to clipboard

Support PostgreSQL in official docker image

Open jhass opened this issue 2 years ago • 2 comments

Could you please install psycopg2 in the official docker image, or create a variant with it installed? PostgreSQL seems well supported with DATABASE_ENGINE=transaction_hooks.backends.postgresql_psycopg2 otherwise.

Having to run apt-get update; apt-get install -y python3-dev libpq-dev build-essential; pip3 install psycopg2; source /var/local/ralph/docker-entrypoint.sh as the entrypoint seems a little silly... :)

jhass avatar Apr 13 '23 14:04 jhass

Hello, you can also do this more efficiently and in a more user-friendly way. Try inheriting from the base image by writing your own Dockerfile with an additional package. Try this:

FROM allegro/ralph

# Install additional packages
RUN pip3 install psycopg2-binary==2.7.4

and run docker build -t psyco-ralph . and use psyco-ralph image in your stack (docker-compose?).

ar4s avatar Apr 20 '23 18:04 ar4s

I'm doing this right now, yes.

It's just one more thing to maintain, or given I'm running on k8s it's a custom docker registry and build process just for this, while I imagine publishing another tag should be a fairly minor addition to your build pipeline 🙂

jhass avatar Apr 21 '23 07:04 jhass