15 lines
552 B
Docker
15 lines
552 B
Docker
FROM python:3.14-slim
|
|
WORKDIR /app
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
COPY . .
|
|
# Expose dynamic port
|
|
EXPOSE 8798
|
|
|
|
# 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"] |