Anjali04-15 commited on
Commit
d6d410e
·
verified ·
1 Parent(s): 7f8df3c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -10
Dockerfile CHANGED
@@ -1,18 +1,24 @@
1
- # Use official Python image as base
2
- FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy requirements and install
8
- COPY requirements.txt .
9
- RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy app files
12
- COPY . .
 
 
 
13
 
14
- # Expose port 7860 (default for HF Spaces)
 
 
 
 
15
  EXPOSE 7860
16
 
17
- # Command to run your FastAPI app with Uvicorn
18
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use official Python slim image
2
+ FROM python:3.9-slim
3
 
4
+ # Set working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Copy all files from current directory to /app in the container
8
+ COPY . /app
 
9
 
10
+ # Install system dependencies for PIL and PyTorch
11
+ RUN apt-get update && apt-get install -y \
12
+ gcc \
13
+ libgl1-mesa-glx \
14
+ && rm -rf /var/lib/apt/lists/*
15
 
16
+ # Upgrade pip and install python dependencies
17
+ RUN pip install --upgrade pip
18
+ RUN pip install -r requirements.txt
19
+
20
+ # Expose the port your FastAPI app will run on (7860 is standard on Hugging Face Spaces)
21
  EXPOSE 7860
22
 
23
+ # Run the FastAPI app with uvicorn
24
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]