Database setup only has to occur the very first time you set up your local gen3 Docker Compose environment, as this docker-compose environment is configured to create a persistent volume for Postgres. The environment configuration is set up to automatically run setup scripts for the postgres container and set up the following:
- 5 databases
metadata(Used bymetadata-service)metadata_db(Used bysheepdogandperegrine)fence_dbindexd_dbarborist_db
- 6 users with passwords and superuser access
metadata_userfence_userperegrine_usersheepdog_userindexd_userarborist_user
NOTE: You can use docker compose override to configure the Postgres database container and publish the db service port to the host machine by changing the
portsblock under thepostgresservice indocker-compose.override.yml, then rundocker-compose up -d postgres:
cp docker-compose.override.sample.yml docker-compose.override.yml
The container host can connect to the database after the port is published - ex:
psql -h localhost -U fence_user -d fence_db
Heads-up: Similarly, you can add/override your custom docker compose config parameters/values in
docker-compose.override.ymland keep the base config clean. See docker compose documentation for more.