FS#77536 - [docker-compose] Add a systemd service file

Attached to Project: Community Packages
Opened by Patrick Stewart (patstew) - Wednesday, 15 February 2023, 14:09 GMT
Last edited by Morten Linderud (Foxboron) - Sunday, 11 June 2023, 14:01 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Lukas Fleischer (lfleischer)
Andrew Crerar (andrewSC)
Morten Linderud (Foxboron)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

It would be useful to have a systemd service for starting docker compose e.g:

docker-compose@.service

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service

[Service]
WorkingDirectory=/etc/docker/compose/%i
ExecStartPre=-/usr/bin/docker compose pull
ExecStart=/usr/bin/docker compose up --remove-orphans
ExecStop=/usr/bin/docker compose down
ExecReload=/usr/bin/docker compose pull
ExecReload=/usr/bin/docker compose up --remove-orphans

[Install]
WantedBy=multi-user.target


This allows the user to make or link to a directory containing compose.yaml, a .env file etc at /etc/docker/compose/project and then start on boot with systemctl enable --now docker-compose@project.service
This task depends upon

Closed by  Morten Linderud (Foxboron)
Sunday, 11 June 2023, 14:01 GMT
Reason for closing:  No response
Comment by Toolybird (Toolybird) - Friday, 17 February 2023, 23:30 GMT
Related  FS#68633 

You should probably contact upstream and ask them to implement this feature?
Comment by Morten Linderud (Foxboron) - Friday, 17 February 2023, 23:34 GMT
Is `/etc/docker/compose/project` something you invented for this feature request, or something relied upon by the project itself?

Loading...