fix: entrypoint workdir and static path
This commit is contained in:
+3
-2
@@ -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
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user