Added systemd service file example

This commit is contained in:
Peter Morton 2023-10-18 09:10:10 -05:00
parent 2203c64d0f
commit aebc2db61e

View File

@ -0,0 +1,17 @@
[Unit]
Description=eo-services
Requires=docker.service
After=docker.service
[Service]
Restart=always
User=root
Group=docker
WorkingDirectory=/opt/em/projects/current/demo/eo-services
# Shutdown container (if running) when unit is started
ExecStartPre=/usr/bin/docker compose down
# Start container when unit is started
ExecStart=/usr/bin/docker compose up
# Stop container when unit is stopped
ExecStop=/usr/bin/docker compose down
[Install]
WantedBy=multi-user.target