File size: 829 Bytes
3c27def
 
 
fd4855b
3c27def
fd4855b
414e389
fd4855b
 
3c27def
6a8c8dc
 
3cdea46
 
2694ac7
3cdea46
 
fd4855b
3c27def
fd4855b
 
c74a427
3c27def
fd4855b
640ccfa
 
627ba9d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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"]