- What do you need?
- Run the composition
- Stop the composition
- Remove/Delete volumes
- Demo data
- Env file
- docker-compose.yml
In order to execute the run script you need:
- jq
- docker-compose
Installation example in Ubuntu:
sudo apt install jq docker-compose
For docker-compose you can also see here.
Copy the folder example
to docker-example
and do your configuration.
⚠️ DO NOT USE theexample
folder as is in production: theexample
folder provides secrets that MUST be not used in a production environment. It sole purpose is to provide a user friendly starting point.
Execute the run script for the first time:
./run-docker-compose.sh
The following docker volumes are created, if they doesn't exist yet:
- satosa-saml2spid_nginx_certs
- satosa-saml2spid_mongodata
The satosa-saml2spid_nginx_certs is populated with data from nginx/certs/`, satosa-saml2spid_mongodata is populated by MongoDB container with its storage.
After having executed the docker compose you can see the logs of the running containers:
docker-compose -f docker-compose.yml logs -f
After the first run, you can start the docker compose with the run script or by this commands:
docker-compose pull; docker-compose down -v; docker-compose up -d; docker-compose logs -f
Command:
docker volume ls
Output:
DRIVER VOLUME NAME
local satosa-saml2spid_mongodata
local satosa-saml2spid_nginx_certs
In RedHat and Ubuntu based OS the Docker volumes directory is at:
# ls -1 /var/lib/docker/volumes/
satosa-saml2spid_mongodata
satosa-saml2spid_nginx_certs
./stop-docker-compose.sh
This script stops all containers of the composition and detaches the volumes, but keeps the data on the persistent volumes.
If you want to start from scratch, or just clear all persistent data, just run the following script:
./rm-persistent-volumes.sh
First, the containers of the composition are stopped and the volumes are detached.
Then you are asked if you want to delete the volumes and if you answer yes, you have to confirm volume by volume.
Demo data for a test client are inserted into the DB during the first run of the composition.
See mongo readme to have some example of demo data.
Customize the environment variables using the .env file.
The file .env.example provides an example with all the environment variables you can set.
The variables not set in the .env
file will fallback on a default value defined in the docker-compose.yml.
⚠️ Be careful when deploying your solution since some environment variables are security-related.
See mongo readme for explanation of environment variables of MongoDB.