Add production service deployment

This commit is contained in:
Codex 2026-09-03 19:23:39 +00:00
parent 29bd6b3fd8
commit 727a9b3793
3 changed files with 28 additions and 1 deletions

View file

@ -16,6 +16,6 @@
} }
handle { handle {
redir /app/ 308 redir * /app/ 308
} }
} }

15
deploy/reload-caddy.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
set -u
attempt=0
while [ "$attempt" -lt 12 ]; do
if /usr/bin/caddy reload \
--config /home/snw/bot_save_bablo/data/Caddyfile.runtime \
--adapter caddyfile; then
exit 0
fi
attempt=$((attempt + 1))
sleep 5
done
exit 1

12
deploy/run.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
set -eu
cd /home/snw/bot_save_bablo
set -a
. ./.env
set +a
exec /usr/bin/flock -n /tmp/pozhitki.lock \
/home/snw/bot_save_bablo/.venv/bin/uvicorn app.main:app \
--host 127.0.0.1 \
--port 8765