Mrigank005 commited on
Commit
61a5d17
·
verified ·
1 Parent(s): 380e10b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -29
Dockerfile CHANGED
@@ -1,30 +1,30 @@
1
- # Use Python 3.10 slim image
2
- FROM python:3.10-slim
3
-
4
- # Set the working directory
5
- WORKDIR /app
6
-
7
- # Create a non-root user (Mandatory for Hugging Face Spaces)
8
- RUN useradd -m -u 1000 user
9
- USER user
10
- ENV HOME=/home/user \
11
- PATH=/home/user/.local/bin:$PATH
12
-
13
- # Set working directory to the user's home
14
- WORKDIR $HOME/app
15
-
16
- # Copy requirements first to leverage Docker cache
17
- COPY --chown=user:user requirements.txt .
18
-
19
- # Install dependencies
20
- RUN pip install --no-cache-dir --upgrade pip && \
21
- pip install --no-cache-dir -r requirements.txt
22
-
23
- # Copy the rest of the application
24
- COPY --chown=user:user . .
25
-
26
- # Expose the port Hugging Face expects
27
- EXPOSE 7860
28
-
29
- # Command to run the application
30
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use Python 3.10 slim image
2
+ FROM python:3.11-slim
3
+
4
+ # Set the working directory
5
+ WORKDIR /app
6
+
7
+ # Create a non-root user (Mandatory for Hugging Face Spaces)
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH
12
+
13
+ # Set working directory to the user's home
14
+ WORKDIR $HOME/app
15
+
16
+ # Copy requirements first to leverage Docker cache
17
+ COPY --chown=user:user requirements.txt .
18
+
19
+ # Install dependencies
20
+ RUN pip install --no-cache-dir --upgrade pip && \
21
+ pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Copy the rest of the application
24
+ COPY --chown=user:user . .
25
+
26
+ # Expose the port Hugging Face expects
27
+ EXPOSE 7860
28
+
29
+ # Command to run the application
30
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]