Interacting with the stack using Make
The Makefile contains a number of make targets that make interacting the stack more user-friendly. All Makefile commands need to be run from the root directory of the CanDIGv2 repo.
Stopping services
All services can be stopped with:
Individual services can be stopped using the docker command:
eg. to stop the ingest container this would be:
Starting services
Logging must be started first, postgres should be started before any relying services
When all containers are stopped the following command can be used to start all CanDIGv2 containers
To start a single container, the following docker command can be used:
e.g. for the ingest container:
Cleaning and rebuilding individual services
If any individual services are updated, they will need to be cleaned, rebuilt and recomposed.
Any individual service can be cleaned with:
This command runs all the steps needed to clean and rebuild the service, the commands are explained in more detail below:
for example:
This stops the container, deletes the container and deletes the image.
To rebuild and recompose a service first run:
Then compose the container with:
Some services can’t be rebuilt individually without causing issues with the stack, if you are facing issues with modules related to auth, it is recommended to rebuild the entire stack to ensure everything is in sync.
Non-destructive Rebuild
To rebuild the CanDIGv2 without destroying data in postgres or keycloak the make target rebuild-keep-data
with:
Destructive Cleanup
Use the following steps to clean up running CanDIGv2 services in a docker-compose configuration.
The following steps are performed by make clean-all
:
See the Makefile for the exact commands that each of these targets runs.
Rebuild entire stack from scratch
-
Perform any backups of data necessary if in a non-testing environment. (see backup and restore doc for detailed instructions.)
-
Clean up the current containers with
make clean-all
-
When complete, build all containers again with
make build-all