DerYur commited on
Commit
fcf2131
·
verified ·
1 Parent(s): 06be948

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -10
Dockerfile CHANGED
@@ -1,17 +1,22 @@
1
- # Use official Python image
2
- FROM python:3.11-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy all files
8
- COPY . /app
9
 
10
- # Install dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Expose port
14
- EXPOSE 8000
 
 
 
 
 
 
 
15
 
16
- # Run FastAPI app
17
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # Use a lightweight Python image
2
+ FROM python:3.10-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install OS-level dependencies
8
+ RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Copy your project files into the container
11
+ COPY . .
12
 
13
+ # Upgrade pip and install Python dependencies
14
+ RUN pip install --upgrade pip
15
+ RUN pip install -r requirements.txt
16
+
17
+ # Expose the port Hugging Face Spaces expects
18
+ EXPOSE 7860
19
+
20
+ # Run the FastAPI app
21
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
22