|
|
|
|
|
FROM python:3.11-slim |
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \ |
|
|
PYTHONDONTWRITEBYTECODE=1 \ |
|
|
PIP_NO_CACHE_DIR=1 \ |
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1 |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
gcc \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
|
RUN mkdir -p logs |
|
|
|
|
|
|
|
|
EXPOSE 8000 |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
|
|
CMD python -c "import requests; requests.get('http://localhost:8000/health')" || exit 1 |
|
|
|
|
|
|
|
|
CMD ["python", "-m", "uvicorn", "api_server_extended:app", "--host", "0.0.0.0", "--port", "8000"] |
|
|
|