This document describes how to deploy the application suite locally for development purposes.
The postgres database service is defined in the docker-compose.yml file, but after creation it must be set up and populated manually. The following steps describe how to do this.
-
Navigate to the
local-deploymentdirectory. -
Copy the
sample.envfile to.envand set DOCKER_HOST_IP to the IP address of the host machine. -
Spin up the database with the following command:
docker compose up -d postgres
-
Open WSL and navigate to the root of the repository.
-
Make sure that psql is installed on your machine. If it is not, install it using the following command:
sudo apt-get install postgresql-client
-
Navigate to the
db-scripts/pgsql/setupdirectory -
Copy the
sample.envfile to.envand edit the file to specify the database connection information. -
Run the following command to set up the database:
./setup.sh
-
Navigate to the
db-scripts/pgsql/static-datadirectory -
Copy the
sample.envfile to.envand edit the file to specify the database connection information. -
Run the following command to populate the database with static data:
./insert-static-data.sh
-
Set wal_level to 'logical' by executing the following query:
```sql ALTER SYSTEM SET wal_level = 'logical'; ``` -
Restart the database service:
```bash docker compose restart postgres ```
The dockerfiles for the TIMM services expect the JAR files to be in the same directory as the Dockerfile. After compilation, copy the JAR files to the appropriate directories.
The certificate file that is being used must be present in the same directory as the Dockerfile for the cv-data-tasks service.
Several database objects are mocked and can be created using the scripts in db-scripts\pgsql\mocking\sql. Depending on what is being tested, these may or may not be necessary.
After the database is set up and the JAR files are in place, run the following command in the local-deployment directory:
docker compose up --build -dThis will build and run the suite in detached mode. To view logs, use the following command:
docker compose logs -fTo stop the suite, run the following command in the local-deployment directory:
docker compose downTo reset the database, run the following command in the local-deployment directory:
docker compose down -vThis will remove the database volume, effectively resetting the database.