GreenWizard2015 commited on
Commit
d0056da
1 Parent(s): 6e5d875

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Very weird Dockerfile, which is clone my repo and run application
2
+ # I just don't want to maintain multiple repos and other sht
3
+ FROM python:3.10
4
+
5
+ # Some stuff to make it work on Hugging Face
6
+ RUN apt-get update && apt-get install -y libsm6 libxext6 cmake libgl1-mesa-glx
7
+ RUN --mount=target=pre-requirements.txt,source=pre-requirements.txt pip install --no-cache-dir -r pre-requirements.txt
8
+ RUN pip install --no-cache-dir gradio tensorflow tensorflow-probability opencv-python wandb
9
+
10
+ # Set up environment
11
+ COPY --link --chown=1000 ./ /home/user/app
12
+ WORKDIR /home/user/app
13
+ RUN useradd -m -u 1000 user && cd /home/user/app
14
+ USER user
15
+ ENV PATH=/home/user/.local/bin:$PATH
16
+
17
+ # Clone the repo and install the requirements
18
+ ADD "https://api.github.com/repos/GreenWizard2015/dog-breed-classification/git/ref/heads/main" skipcache
19
+ RUN git clone https://github.com/GreenWizard2015/dog-breed-classification/ && \
20
+ cp -r dog-breed-classification/* . && \
21
+ rm -rf dog-breed-classification && \
22
+ pip install --no-cache-dir -r requirements.txt
23
+
24
+ CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]