Talent-Catalog / talentcatalog

https://tctalent.org
GNU Affero General Public License v3.0
13 stars 4 forks source link

Readme on Docker-Compose Postgres edit #1662

Open samschlicht opened 18 hours ago

samschlicht commented 18 hours ago

Currently our readme instructs to run containerised postgresql using docker-compose, but then departs to give instructions to install locally (which is not needed), verify that it is installed locally, and populate the local DB.

Suggest we change the local instructions to docker ones and also perhaps a brief description how to connect IntelliJ.

samschlicht commented 17 hours ago

(Starts from after the docker-compose section of readme, which is all good)

Verify that Docker is up and running, incl. containerised Postgres: docker ps

Verify that tctalent is up and running within that container: docker exec -it docker-compose-postgres-1 psql -U tctalent -d tctalent should open the psql console — /q to exit the psql console at any time.

For existing dev Make a dump of the containerised DB: docker exec -it docker-compose-postgres-1 pg_dump --file=/tmp/dump.sql --create --username=tctalent --host=localhost --port=5432 Copy the file from the docker container to local system: docker cp docker-compose-postgres-1:/tmp/tcdump.sql </path/to/file> Send to new dev

New dev Copy the DB dump from your local system to your docker container: docker cp <path/to/file> docker-compose-postgres-1:/tmp/dump.sql Populate the docker DB from the dump: docker exec -it docker-compose-postgres-1 psql -U tctalent -d tctalent -f /tmp/dump.sql

Connect IntelliJ to the docker DB: Database > New > Data Source > PostgreSQL

  1. Give the DB a name that distinguishes it clearly from Staging and Prod DBs that you later may add
  2. Populate the other parameters with the default values in the postgres configuration of project file docker-compose.yml

Optional: for existing devs to understand that they no longer need to have postgres installed locally brew uninstall postgresql