Skip to content

Commit 0228322

Browse files
feat: Add systemd service for Streamlit deployment
1 parent 4d0e500 commit 0228322

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/deploy.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ jobs:
1717
- name: "Move files to /opt/streamlit"
1818
run: |
1919
sudo cp -r . /opt/streamlit
20+
sudo cp streamlit.service /etc/systemd/system/streamlit.service
21+
sudo systemctl daemon-reload
22+
sudo systemctl restart streamlit

streamlit.service

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Streamlit Service
3+
4+
[Service]
5+
User=root
6+
WorkingDirectory=/opt/streamlit
7+
ExecStart=poetry run streamlit run streamlit/main.py --server.runOnSave true --ui.hideTopBar true
8+
Restart=always
9+
RestartSec=3
10+
11+
[Install]
12+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)