Skip to content

Commit

Permalink
feat: Add systemd service for Streamlit deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
endersonmenezes committed May 2, 2024
1 parent 4d0e500 commit 0228322
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ jobs:
- name: "Move files to /opt/streamlit"
run: |
sudo cp -r . /opt/streamlit
sudo cp streamlit.service /etc/systemd/system/streamlit.service
sudo systemctl daemon-reload
sudo systemctl restart streamlit
12 changes: 12 additions & 0 deletions streamlit.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Streamlit Service

[Service]
User=root
WorkingDirectory=/opt/streamlit
ExecStart=poetry run streamlit run streamlit/main.py --server.runOnSave true --ui.hideTopBar true
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

0 comments on commit 0228322

Please sign in to comment.