.
├── docker-compose.override.yml # local development configuration only
├── docker-compose.rancher.yml # production-like configuration only
├── docker-compose.yml # common configuration
├── prod-compose.sh # Rancher stack deployment script
├── rancher_cli.env # Rancher API keys
└── shared_vars.env # the values of all public and secret environment variables
// create and fill shared_vars.env file (ignored by git)
cp shared_vars.env.template shared_vars.env
edit shared_vars.env
(after Environment variables setup)
docker-compose up
(after Environment variables setup)
// Check values for the public variables in `check_compose_variables` function.
// And create secret files in `create_secrets_files` function.
edit prod-compose.sh
As you can see, prod-compose.sh manages the environment variables:
- Public environment variables will be read from the current environment.
- Secret environment variables will be saved in separate files in
secretsdirectory.
(after Public and secret environment variables for production-like configuration)
Remember to start Rancher Secrets from Catalog before the deployment!
To deploy use your Rancher Account API Key (it can be shared between projects in different environments as well) or create a new one:
Open the Rancher GUI and click in the top panel API → Keys and then click
Add Account API Keys.
// create and fill rancher_cli.env file (ignored by git)
cp rancher_cli.env.template rancher_cli.env
edit rancher_cli.env
./prod-compose.sh