This commit is contained in:
Vladislav 2026-07-22 22:03:32 -04:00
parent 3850e58e47
commit 7ebd50f9bd

View File

@ -549,6 +549,36 @@
"ssh kultmost 'systemctl daemon-reload && systemctl enable --now production.service && systemctl status --no-pager -l production.service'\n" "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", "cell_type": "markdown",
"id": "dfd8deed", "id": "dfd8deed",
@ -606,9 +636,24 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"!ssh kultmost 'systemctl restart production.service'\n",
"!ssh kultmost 'systemctl restart fastapi.service'" "!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", "cell_type": "code",
"execution_count": null, "execution_count": null,