SebaK13 commited on
Commit
de078c0
1 Parent(s): 59234db

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -11
Dockerfile CHANGED
@@ -1,18 +1,17 @@
1
  FROM python:3.10.14
2
-
 
3
  RUN useradd -m -u 1000 user
 
4
 
5
- # Switch to the "user" user
6
- USER user
7
 
8
- # Copy the current directory contents into the container at .
9
- COPY . .
10
 
11
- # Set the working directory to /
12
- WORKDIR /
13
 
14
- # Install requirements.txt
15
- RUN pip install --no-cache-dir --upgrade -r /requirements.txt
16
 
17
- # Start the FastAPI app on port 7860, the default port expected by Spaces
18
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10.14
2
+ # The two following lines are requirements for the Dev Mode to be functional
3
+ # Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
4
  RUN useradd -m -u 1000 user
5
+ WORKDIR /app
6
 
7
+ COPY --chown=user ./requirements.txt requirements.txt
8
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
9
 
10
+ COPY --chown=user . /app
 
11
 
12
+ USER user
 
13
 
14
+ ENV HOME=/home/user \
15
+ PATH=/home/user/.local/bin:$PATH
16
 
17
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]