|
|
|
|
|
FROM python:3.11-slim |
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \ |
|
|
PYTHONDONTWRITEBYTECODE=1 \ |
|
|
PIP_NO_CACHE_DIR=1 \ |
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \ |
|
|
ENABLE_AUTO_DISCOVERY=false |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
gcc \ |
|
|
g++ \ |
|
|
curl \ |
|
|
&& 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 data data/exports data/backups |
|
|
|
|
|
|
|
|
EXPOSE 7860 8000 |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ |
|
|
CMD curl -f http://localhost:${PORT:-8000}/health || exit 1 |
|
|
|
|
|
|
|
|
CMD ["sh", "-c", "uvicorn api_server_extended:app --host 0.0.0.0 --port ${PORT:-8000}"] |
|
|
|