Skip to content

Instantly share code, notes, and snippets.

@JesseBowling
Last active February 4, 2021 03:05
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 JesseBowling/913f8a581361204165f9c0a4da4d1539 to your computer and use it in GitHub Desktop.
Save JesseBowling/913f8a581361204165f9c0a4da4d1539 to your computer and use it in GitHub Desktop.
Sample SystemD config for CHN
[Unit]
Description=CHNServer service with docker compose
Requires=docker.service
After=docker.service
[Service]
Restart=always
WorkingDirectory=/opt/chnserver
# Remove old containers and pull updates to current tag
ExecStartPre=/usr/bin/docker-compose down
ExecStartPre=/usr/bin/docker-compose rm
ExecStartPre=/usr/bin/docker-compose pull
# Compose up
ExecStart=/usr/bin/docker-compose up
# Compose down, remove containers
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