File size: 1,103 Bytes
d0056da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Very weird Dockerfile, which is clone my repo and run application
# I just don't want to maintain multiple repos and other sht
FROM python:3.10

# Some stuff to make it work on Hugging Face
RUN apt-get update && apt-get install -y libsm6 libxext6 cmake libgl1-mesa-glx
RUN --mount=target=pre-requirements.txt,source=pre-requirements.txt 	pip install --no-cache-dir -r pre-requirements.txt
RUN pip install --no-cache-dir gradio tensorflow tensorflow-probability opencv-python wandb

# Set up environment
COPY --link --chown=1000 ./ /home/user/app
WORKDIR /home/user/app
RUN useradd -m -u 1000 user && cd /home/user/app
USER user
ENV PATH=/home/user/.local/bin:$PATH

# Clone the repo and install the requirements
ADD "https://api.github.com/repos/GreenWizard2015/dog-breed-classification/git/ref/heads/main" skipcache
RUN git clone https://github.com/GreenWizard2015/dog-breed-classification/ && \
    cp -r dog-breed-classification/* . && \
    rm -rf dog-breed-classification && \
    pip install --no-cache-dir -r requirements.txt
    
CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]