Commit 83403a43 authored by Vitali Stupin's avatar Vitali Stupin
Browse files

Adding systemd configuration

parent 96332eac
......@@ -73,4 +73,13 @@ For testing copy nginx csapi.crt to client and issue curl command:
curl --cert client.crt --key client.key --cacert csapi.crt -i -d '{"member_code": "XX000003", "member_name": "XX Test 3", "member_class": "GOVXXX"}' -X POST https://jan-center2.ci.kit:5443/member
```
Add nginx configuration from this repository: `nginx/csapi` to nginx server: `/etc/nginx/sites-enabled/csapi`
\ No newline at end of file
Add nginx configuration from this repository: `nginx/csapi` to nginx server: `/etc/nginx/sites-enabled/csapi`
## Systemd
Add service description `csapi.service` to `/etc/systemd/system/csapi.service`. Then start and enable automatic startup:
```bash
sudo systemctl daemon-reload
sudo systemctl start csapi
sudo systemctl enable csapi
```
[Unit]
Description=CS API
After=network.target
[Service]
User=xroad
Group=www-data
WorkingDirectory=/opt/csapi
Environment="PATH=/opt/csapi/venv/bin"
ExecStart=/opt/csapi/venv/bin/gunicorn --workers 4 --bind unix:/opt/csapi/socket/csapi.sock -m 007 server:app
[Install]
WantedBy=multi-user.target
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment