demo/sverigekartan/sverigekartan.service
# Example systemd USER unit for Sverigekartan. Run it from a git worktree of the
# deployed branch (<app-dir> = that worktree's demo/sverigekartan), so work on other
# branches never reaches the live page. Install:
# cp sverigekartan.service ~/.config/systemd/user/
# systemctl --user daemon-reload && systemctl --user enable --now sverigekartan.service
[Unit]
Description=Sverigekartan: Streamlit demo of the korp-map Sweden map on :8501
After=network-online.target korp-map.service
[Service]
WorkingDirectory=<app-dir>
# The BROWSER fetches the map from the page's own https origin when the page is opened
# under one of these names (rpxy routes /v1 to korp-map), else from the first one.
# Python's address search uses the internal URL (same host, no hairpin).
Environment=SVERIGEKARTAN_PUBLIC_HOSTS=karta.gunnar.rs,sverigekartan.gunnar.rs,83-190-65-118.sslip.io
Environment=SVERIGEKARTAN_MAP_SERVER_INTERNAL=http://127.0.0.1:8765
ExecStart=<venv>/bin/streamlit run app.py --server.address 0.0.0.0 --server.port 8501 --server.headless true --browser.gatherUsageStats false --client.toolbarMode viewer
Restart=always
RestartSec=3
[Install]
WantedBy=default.target