I want to run some containers via systemd and each one has an an associated compose file so that it should be possible to write just one systemd unit file and specify the compose file as the instance name. Thus, the unit file will contain something like:
ExecStart=/usr/local/bin/docker-compose -f %i.yaml up However, this neat scheme is spoilt by some dependencies betweeen the containers. Normally one would deal with such dependencies with a Requires declaration in the unit file but in this situation there is only one unit file. Is it possible to set up the dependencies outside any unit file, and if so, how?
Example: n-tier-app.yaml depends on basic-services.yaml