Database PostgreSQL
March 13, 2025 · View on GitHub
The database used in LandGriffon is PostgreSQL.
To setup it properly first you have to configure some environment variables and then start the PostgreSQL container.
1. System dependencies
- Docker: used to start PostgreSQL so that it does not need to be installed in the host.
2. Configure environment variables
You need to setup some environment variables before starting PostgreSQL. Using docker compose and the docker-compose.yml file at the root of the repository, you can start it without manually set the environment variables in the shell.
Environment variables needed and which service uses it is explained in the ENV_VARS.md file.
3. Start the container
3.1. Configure environment variables
PG_H3_VERSIONUsed to set a build argument of the same name (default:3.7.2).API_POSTGRES_PORTUsed to set the exported port to connect to the database (default:5432)API_POSTGRES_PASSWORD(used to setPOSTGRES_PASSWORDin the container)API_POSTGRES_USERNAME(used to setPOSTGRES_USERin the container)API_POSTGRES_DATABASE(used to setPOSTGRES_DBin the container)
3.2. Start the service
To start the database service just execute:
docker compose up postgresql