ju2ez commited on
Commit
628e9f1
·
1 Parent(s): 06c03c5
Files changed (1) hide show
  1. Dockerfile +11 -4
Dockerfile CHANGED
@@ -1,13 +1,20 @@
1
  # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.9
5
 
6
- WORKDIR /code
 
7
 
8
- COPY ./requirements.txt /code/requirements.txt
 
9
 
10
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
11
 
12
  COPY . .
13
 
 
1
  # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
+ FROM python:3.10-slim
5
 
6
+ # Set the working directory to the user's home directory
7
+ WORKDIR $HOME/app
8
 
9
+ # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
10
+ RUN pip install --no-cache-dir --upgrade pip
11
 
12
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
13
+ COPY --chown=user . $HOME/app
14
+
15
+ COPY ./requirements.txt $HOME/app/requirements.txt
16
+
17
+ RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
18
 
19
  COPY . .
20