Show HN: Postgres Docker image with common extensions
github.com
github.com
[0]: https://github.com/supabase/postgres/blob/de88f3dc1c80fbf7d1...
I personally prefer a different setup, but any team that already has a strong skill set in both tools may benefit from building on top of preecisting domain knowledge.
Here, Ansible is used to build the image itself, which is, afaik, less common. But don't see why it can't be done though.
Ansible is a tool for provisioning a system in a particular way. What's the difference between running ansible against an ephemeral VM vs running against a container?
One of the maintainers commented in a sibling comment to yours that they use the same ansible to build VM images, so that was more work.
> and then using `docker commit` (a command I've barely used/seen being used in my 2+ years of using docker daily).
Well, if you use Dockerfiles then of course you won't see a command used mostly by alternative build processes, but that's hardly a meaningful objection.
[0]: https://github.com/supabase/postgres/blob/0c5178588791d9472c...
As there are multiple approaches to address that issue (I use Dockerfile templates with loops for example, but I am not a fan of them), I was wondering if you considered different approaches too. In my experience, users like to have regular Dockerfile, as they are familiar with it. Would it be possible or make sense in your opinion to run Ansible inside the Dockerfile and keep a more standard approach to Docker image building?
Disclaimer: I am not familiar with Ansible.
For context, producing AWS EC2/ DO droplet images are more of the more important objectives of the repository. Hence, the idea of using Ansible which is used to build these images naturally became the first approach in order to consolidate everyone together.
As for running Ansible inside the Dockerfile, I have yet to try that out myself but it does sound possible since one can run Ansible on itself locally. Would have definitely considered it as the next approach to attempt if the first one failed.
Ie rather than the typical "apt install" have "ansible" in the build-part?
Wouldn't be better to run the same image with different commands or have one image for each service? Logs are usually written to stdout/stderr in containers, so they can be gathered, aggregated, stored etc. by Docker or Kubernetes and handled with the tools you like the most, without having to share log volumes across services and having multiple ways to handle and rotate logs to maintain.
But yes, generally it's not considered a good practice.
[0]: https://hub.docker.com/r/supabase/postgres
[1]: https://github.com/supabase/postgres#extensions
[2]: https://github.com/supabase/postgres#enhanced-security
[3]: https://github.com/supabase/postgres#additional-goodies
The image runs postgres directly indeed, but in the entrypoint, and then keeps it open using tail -f /dev/null. That, together with Ansible, makes it pretty peculiar image :)
I believe with PL/V8 we should be able to run/render JavaScript+Web applications (database)server-side!
But the database was rendering, and even caching and had these wild stored procedures. It was performant compared to the typical ASP that was popular at the time. We used all your RAM :)
LATELLY, one may want to look at yugabyte and cockroachdb - they have wire compatibility with pg protocol. Depending on the way you use pg, it might be a much better choice for you. It's cloud native, have enterprise support, etc.
One other request - could you write how to use it (connect to it) ?
But recently I got the occasion to work with https://github.com/CrunchyData/postgres-operator .
It's a bit rough around the edges wit the v5, which is very recent, but overall I was really happy with it.
I am still not using it in production but it's on the way.
You can still connect the DB with a PgBouncer image spun up in another container however. Unfortunately, I can't really recommend you which one since there doesn't seem to be an official Docker image for PgBouncer and I myself have never tried any of the existing ones out there. If you're looking to use PostgREST however, they do have an official Docker image that you can use over here [4].
[0]: https://hub.docker.com/r/supabase/postgres
[1]: https://github.com/supabase/postgres#extensions
[2]: https://github.com/supabase/postgres#enhanced-security
[3]: https://github.com/supabase/postgres#additional-goodies