compdemocracy / polis

:milky_way: Open Source AI for large scale open ended feedback
https://pol.is
GNU Affero General Public License v3.0
781 stars 183 forks source link

Enable non-docker postgres #1817

Closed ballPointPenguin closed 1 month ago

ballPointPenguin commented 1 month ago

utilize docker compose --profile postgres, and POSTGRES_DOCKER var, to enable/disable using dockerized postgres.

For using docker compose directly

Now, by default, docker compose ... will NOT run a dockerized postgres service. You must provide a valid DATABASE_URL in your environment. To continue using the dockerized postgres service, all docker compose commands must include the flag --profile postgres

For using make

The Makefile will read POSTGRES_DOCKER in your env file. If it is false, it will not include the postgres docker service. However, if POSTGRES_DOCKER=true (defaults to true if unset), then make will run as before, including postgres docker service (via --profile postgres) in all of its actions.

TL;DR

To disable docker postgres, include POSTGRES_DOCKER=false in your .env (or prod.env).

To keep using docker postgres, do nothing (if using make), or amend any docker compose calls with --profile postgres.

Closes https://github.com/compdemocracy/polis/pull/1749 and https://github.com/compdemocracy/polis/issues/1751

ballPointPenguin commented 1 month ago

Prior to https://github.com/compdemocracy/polis/pull/1816, the Github actions are expected to fail