RajatMalviya commited on
Commit
b4b51c9
·
verified ·
1 Parent(s): ef8e2eb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -5
Dockerfile CHANGED
@@ -1,21 +1,23 @@
1
  # Use a lightweight Python image
2
  FROM python:3.10-slim
3
 
4
- # Set environment variables to avoid Python buffering (better logging)
5
- ENV PYTHONUNBUFFERED=1
 
 
 
6
 
7
  # Set the working directory inside the container
8
  WORKDIR /app
9
 
10
  # Copy and install dependencies
11
  COPY requirements.txt .
12
- RUN pip install --no-cache-dir --upgrade pip && \
13
- pip install --no-cache-dir -r requirements.txt
14
 
15
  # Copy the entire project
16
  COPY . .
17
 
18
- # Expose the port FastAPI runs on
19
  EXPOSE 7860
20
 
21
  # Run FastAPI using Uvicorn
 
1
  # Use a lightweight Python image
2
  FROM python:3.10-slim
3
 
4
+ # Install necessary system dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ libgl1-mesa-glx \
7
+ libglib2.0-0 \
8
+ && rm -rf /var/lib/apt/lists/* # Clean up package lists to reduce image size
9
 
10
  # Set the working directory inside the container
11
  WORKDIR /app
12
 
13
  # Copy and install dependencies
14
  COPY requirements.txt .
15
+ RUN pip install --no-cache-dir -r requirements.txt
 
16
 
17
  # Copy the entire project
18
  COPY . .
19
 
20
+ # Expose the correct port for Hugging Face Spaces
21
  EXPOSE 7860
22
 
23
  # Run FastAPI using Uvicorn