Netflix / lemur-docker

Docker files for the Lemur certificate orchestration tool
170 stars 88 forks source link

Why install Postgresql package in Web? #46

Open taythebot opened 4 years ago

taythebot commented 4 years ago

As I understand you only need to install Postgresql if you intend to host both Lemur and Postgresql on the same machine. (https://lemur.readthedocs.io/en/latest/quickstart/index.html#installing-build-dependencies) But in the docker-compose there is already a Postgresql server started. So why is this package needed at all in the web container?

I know this repo is currently "under maintenance" but I'm currently using this as a base for my own setup.

viranch commented 3 years ago

I believe its for using the postgres CLI in the web image.

peschmae commented 3 years ago

It's not only used to have the postgres cli in the web image, but you also need it to build psycopg2 when installing it from pip.

In a multistage build, you can get away with installing postgres in the build stage, and only installing libpq5 (in debian, not sure what it's called in other distributions) in the final image. You can see an example of this over at unic/lemur-docker#feature/docker-hub-builds