mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 07:30:24 +00:00
22 lines
541 B
Desktop File
22 lines
541 B
Desktop File
[Unit]
|
|
Description=My fastapi app
|
|
Requires=network.target
|
|
After=network.target
|
|
|
|
[Service]
|
|
KillSignal=SIGQUIT
|
|
WorkingDirectory=/data/develop/stackhub/api
|
|
ExecStart=python3 uvicorn main:app --reload
|
|
Restart=always
|
|
Type=notify
|
|
NotifyAccess=all
|
|
StandardError=syslog
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|
|
|
|
|
|
internal_ip=$(ip addr show eth0 | awk '/inet /{split($2, a, "/"); print a[1]}')
|
|
nsenter -m -u -i -n -p -t 1 sh -c "sed -i '/websoft9-apphub/d' /etc/hosts"
|
|
nsenter -m -u -i -n -p -t 1 sh -c "echo $internal_ip websoft9-apphub>> /etc/hosts"
|