Skip to content

Commit

Permalink
adding systemd service template
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonreusch committed Apr 6, 2023
1 parent 61f6851 commit b546e9c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions service/nuztf.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[Unit]
Description=nuztf.service - A Flask application run with Gunicorn.
After=network.target

StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
User=root
Group=root
Environment=KOWALSKI_API_TOKEN="kowalski_token_here"
Environment=SLACK_TOKEN="slack_token_here"
Environment=SLACK_EVENTS_TOKEN="slack_events_token_here"
WorkingDirectory=/root/nuztf/
ExecStart=/root/miniconda3/envs/nuztf/bin/gunicorn --workers 1 --timeout 120 --bind 0.0.0.0:4000 wsgi:nuztf_slackbot

[Install]
WantedBy=multi-user.target

[Service]
Restart=on-failure
RestartSec=15s
2 changes: 1 addition & 1 deletion slackbot_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
nuztf_slackbot = Flask(__name__)

slack_events_adapter = SlackEventAdapter(
os.environ.get("SLACK_EVENTS_TOKEN"), "/slack/events", nuztf_slackbot
os.environ.get("SLACK_EVENTS_TOKEN"), "/slackbot_nuztf/events", nuztf_slackbot
)
slack_web_client = WebClient(token=os.environ.get("SLACK_TOKEN_NUZTF"))

0 comments on commit b546e9c

Please sign in to comment.