|
|
| FROM python:3.9-slim
|
|
|
|
|
| WORKDIR /app
|
|
|
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \
|
| libgl1-mesa-glx \
|
| libglib2.0-0 \
|
| && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
| COPY requirements.txt /app/
|
|
|
|
|
| RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
| RUN mkdir -p /app/cache /app/config && chmod -R 777 /app/cache /app/config
|
|
|
|
|
| ENV HF_HOME=/app/cache \
|
| MPLCONFIGDIR=/app/config/matplotlib \
|
| YOLO_CONFIG_DIR=/app/config/ultralytics
|
|
|
| ENV HUGGINGFACE_HUB_ENABLE_HF_UPGRADE_CHECK=false
|
|
|
| COPY . /app/
|
|
|
|
|
| EXPOSE 8000
|
|
|
|
|
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|