diff --git a/api/autoscaleapi.service b/api/autoscaleapi.service new file mode 100644 index 0000000..057eceb --- /dev/null +++ b/api/autoscaleapi.service @@ -0,0 +1,17 @@ +[Unit] +Description=LXC AutoScale API +After=network.target + +[Service] +User=root +Group=root +Environment="PATH=/usr/local/bin:/usr/bin:/bin" +WorkingDirectory=/usr/local/bin/autoscaleapi +ExecStart=/usr/local/bin/gunicorn --workers 2 --bind 0.0.0.0:5000 app:app + +# Restart on failure +Restart=on-failure +RestartSec=3 + +[Install] +WantedBy=multi-user.target