HNTAI / services /ai-service /Dockerfile.prod
sachinchandrankallar's picture
1200 seconds from 600 secs timeout
733c0c5
Raw
History Blame
806 Bytes
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
POETRY_VIRTUALENVS_CREATE=false
WORKDIR /app
# Install system deps (add build deps only if needed for some packages)
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential gcc git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy only the source tree (we expect requirements.txt at repo root)
COPY services/ai-service/src /app
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt uvicorn[standard]
EXPOSE 7860
ENV PRELOAD_SMALL_MODELS=false
# Use uvicorn directly for FastAPI (ASGI) instead of gunicorn (WSGI)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "1200", "--workers", "4"]