Skip to content

Instantly share code, notes, and snippets.

@daffodilistic
Created May 26, 2021 05:58
Show Gist options
  • Save daffodilistic/7b872941389911167da265a7054d4f14 to your computer and use it in GitHub Desktop.
Save daffodilistic/7b872941389911167da265a7054d4f14 to your computer and use it in GitHub Desktop.
Systemd unit to start a docker container with proper logging
[Unit]
Description=Odoo Docker Container Service
Requires=docker.service network.target
After=docker.service network.target
[Service]
Type=exec
User=root
Group=google-sudoers
WorkingDirectory=/var/docker
ExecStart=/usr/local/bin/docker-compose up --remove-orphans
ExecStop=/usr/local/bin/docker-compose down --remove-orphans
TimeoutStartSec=60
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment