Skip to content

Instantly share code, notes, and snippets.

@karthanistyr
Forked from Luzifer/README.md
Last active April 7, 2018 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthanistyr/051c959724a77fdc5a197a3cf7a542e0 to your computer and use it in GitHub Desktop.
Save karthanistyr/051c959724a77fdc5a197a3cf7a542e0 to your computer and use it in GitHub Desktop.
Running docker-compose-matrix as a systemd service

Running docker-compose-matrix as a systemd service

This not intended for general use.

Files

File Purpose
/etc/compose/matrix/docker-compose.yaml Compose file describing what to deploy
/etc/systemd/system/docker-compose-matrix.service Service unit to start and manage docker compose

Installation

Put the above mentioned files in the corresponding places and let systemd load them:

# systemctl daemon-reload
# systemctl enable docker-compose-matrix
# systemctl start docker-compose-matrix
[Unit]
Description=Docker Compose container starter
After=docker.service network-online.target
Requires=docker.service network-online.target
[Service]
WorkingDirectory=/etc/compose/matrix
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/docker-compose up -d
ExecStop=/usr/bin/docker-compose down
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment