hore
This commit is contained in:
parent
3850e58e47
commit
7ebd50f9bd
45
build.ipynb
45
build.ipynb
@ -549,6 +549,36 @@
|
||||
"ssh kultmost 'systemctl daemon-reload && systemctl enable --now production.service && systemctl status --no-pager -l production.service'\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "d4552baa",
|
||||
"metadata": {
|
||||
"vscode": {
|
||||
"languageId": "shellscript"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%%bash\n",
|
||||
"ssh kultmost 'tee /etc/systemd/system/fastapi.service >/dev/null' <<'EOF'\n",
|
||||
"[Unit]\n",
|
||||
"Description=FastAPI prod service\n",
|
||||
"After=network.target\n",
|
||||
"\n",
|
||||
"[Service]\n",
|
||||
"WorkingDirectory=/app/production\n",
|
||||
"ExecStart=/app/production/.venv/bin/uvicorn main:app --host 127.0.0.1 --port 30080 --workers 8\n",
|
||||
"Restart=always\n",
|
||||
"EnvironmentFile=/app/production/env\n",
|
||||
"\n",
|
||||
"[Install]\n",
|
||||
"WantedBy=default.target\n",
|
||||
"EOF\n",
|
||||
"\n",
|
||||
"ssh kultmost 'systemctl daemon-reload && systemctl enable --now fastapi.service && systemctl status --no-pager -l fastapi.service'\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "dfd8deed",
|
||||
@ -606,9 +636,24 @@
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!ssh kultmost 'systemctl restart production.service'\n",
|
||||
"!ssh kultmost 'systemctl restart fastapi.service'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "a87971ac",
|
||||
"metadata": {
|
||||
"vscode": {
|
||||
"languageId": "shellscript"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!ssh kultmost 'systemctl status production.service'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user