Skip to content

Instantly share code, notes, and snippets.

@ipoddubny
Created July 9, 2016 08:11
Show Gist options
  • Save ipoddubny/21fee86a98c54112612a01ea90b4deb3 to your computer and use it in GitHub Desktop.
Save ipoddubny/21fee86a98c54112612a01ea90b4deb3 to your computer and use it in GitHub Desktop.
systemd docker container unit (Gogs)
# /etc/systemd/system/docker.gogs.service
[Unit]
Description=Gogs container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker run --name=gogs -p 10022:22 -p 127.0.0.1:10080:3000 -v /var/gogs:/data gogs/gogs
ExecStop=/usr/bin/docker stop -t 2 gogs
ExecStopPost=/usr/bin/docker rm -f gogs
[Install]
WantedBy=local.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment