File | Purpose |
---|---|
/etc/compose/docker-compose.yml |
Compose file describing what to deploy |
/etc/systemd/system/docker-compose-reload.service |
Executing unit to trigger reload on docker-compose.service |
/etc/systemd/system/docker-compose-reload.timer |
Timer unit to plan the reloads |
/etc/systemd/system/docker-compose.service |
Service unit to start and manage docker compose |
Put the above mentioned files in the corresponding places and let systemd load them:
# systemctl daemon-reload
# systemctl enable --now docker-compose.service docker-compose-reload.timer
The method shown here is also available as an Ansible role here: luzifer-ansible/docker-compose
Thank you. The first time I ran the last command, to start the services, I got this error:
sudo systemctl start docker-compose docker-compose-reload
docker-compose.service is not active, cannot reload.
Job for docker-compose-reload.service failed because the control process exited with error code.
See "systemctl status docker-compose-reload.service" and "journalctl -xe" for details.
Then I found out that docker-compose perfectly started. Then again I ran just the reload-service
sudo systemctl start docker-compose-reload
And it runs perfectly.