yjernite HF Staff commited on
Commit
6726675
·
verified ·
1 Parent(s): dcc7df9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -10
Dockerfile CHANGED
@@ -1,19 +1,15 @@
1
  # Start from a standard Python 3.9 image
2
  FROM python:3.9-slim
3
 
4
- # Set the working directory inside the container
 
 
5
  WORKDIR /app
6
 
7
- # Set the Hugging Face cache directory to a local folder
8
- ENV HF_HOME=/home/user/huggingface
9
 
10
- # Copy the requirements file and install dependencies
11
- # This is done first to leverage Docker's layer caching
12
- COPY requirements.txt .
13
- RUN pip install --no-cache-dir -r requirements.txt
14
-
15
- # Copy the rest of your backend application code
16
- COPY . .
17
 
18
  # Command to run your FastAPI app on the port configured in your README.md
19
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Start from a standard Python 3.9 image
2
  FROM python:3.9-slim
3
 
4
+ # The two following lines are requirements for the Dev Mode to be functional
5
+ # Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
6
+ RUN useradd -m -u 1000 user
7
  WORKDIR /app
8
 
9
+ COPY --chown=user ./requirements.txt requirements.txt
10
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
12
+ COPY --chown=user . /app
 
 
 
 
 
 
13
 
14
  # Command to run your FastAPI app on the port configured in your README.md
15
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]