Spaces:
Sleeping
Sleeping
| # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
| # you will also find guides on how best to write your Dockerfile | |
| FROM python:3.9 | |
| RUN useradd -m -u 1000 user | |
| RUN mkdir -p /app && chown user:user /app | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| RUN pip install --no-cache-dir huggingface_hub | |
| RUN mkdir -p /app/output && \ | |
| python -c "from huggingface_hub import hf_hub_download; \ | |
| hf_hub_download(repo_id='Albert-CAC/lite_DETECTIVE', filename='lited_best.pth', local_dir='/app/output', local_dir_use_symlinks=False)" | |
| WORKDIR /app | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| COPY --chown=user ./out /app/out | |
| COPY --chown=user . /app | |
| RUN ls -R /app/out | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |