refactor v2

This commit is contained in:
Mateusz Gruszczyński
2026-03-02 09:41:50 +01:00
parent ef6f81fe9e
commit 016b2f5321
20 changed files with 1210 additions and 397 deletions

View File

@@ -5,5 +5,11 @@ ENV PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Expose dynamic port
EXPOSE 8798
CMD ["python", "app.py"]
# Healthcheck
HEALTHCHECK CMD python -c "import requests; r=requests.get('http://localhost:${FLASK_PORT:-8798}',timeout=5);exit(0 if r.ok else 1)" || exit 1
ENV FLASK_PORT=${FLASK_PORT:-8798}
CMD ["sh", "-c", "gunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 --threads 16 --bind 0.0.0.0:$FLASK_PORT --timeout 60 app:app"]