fix: entrypoint workdir and static path

This commit is contained in:
2026-10-16 14:16:49 +00:00
parent 04749ed895
commit 8c25a1dbe1
2 changed files with 6 additions and 6 deletions
+3 -2
View File
@@ -342,8 +342,9 @@ def api_check(model_id: str):
@app.get("/", response_class=HTMLResponse) @app.get("/", response_class=HTMLResponse)
def index(): def index():
with open("/app/static/index.html") as f: with open("/app/app/static/index.html") as f:
return f.read() return f.read()
app.mount("/static", StaticFiles(directory="/app/static"), name="static") app.mount("/static", StaticFiles(directory="/app/app/static"), name="static")
+3 -4
View File
@@ -1,10 +1,9 @@
#!/bin/sh #!/bin/sh
# Entrypoint: настраиваем cron из переменной CHECK_INTERVAL_HOURS
INTERVAL=${CHECK_INTERVAL_HOURS:-3} INTERVAL=${CHECK_INTERVAL_HOURS:-3}
# Записываем crontab для probe echo "0 */$INTERVAL * * * /usr/local/bin/python3 /app/app/probe.py >> /proc/1/fd/1 2>&1" | crontab -
echo "0 */$INTERVAL * * * /usr/local/bin/python3 /app/probe.py >> /proc/1/fd/1 2>&1" | crontab -
cron cron
# Запускаем FastAPI cd /app/app
exec uvicorn main:app --host 0.0.0.0 --port 8000 --workers 1 exec uvicorn main:app --host 0.0.0.0 --port 8000 --workers 1