[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