RajatMalviya commited on
Commit
aff10d7
·
verified ·
1 Parent(s): c00af50

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -26
Dockerfile CHANGED
@@ -1,34 +1,16 @@
1
- FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- git \
9
- && rm -rf /var/lib/apt/lists/*
10
 
11
- # Install PyTorch with CUDA support
12
- RUN pip install --no-cache-dir torch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu118
13
 
14
- # Install FastAPI and other dependencies
15
- RUN pip install --no-cache-dir fastapi==0.104.1 \
16
- uvicorn==0.23.2 \
17
- python-multipart==0.0.6 \
18
- pillow==10.0.1 \
19
- safetensors==0.4.0 \
20
- transformers==4.34.0 \
21
- diffusers==0.23.0 \
22
- accelerate==0.23.0
23
-
24
- # Copy application code
25
- COPY . .
26
-
27
- # Create model directory
28
- RUN mkdir -p models
29
-
30
- # Expose the port the app will run on
31
  EXPOSE 7860
32
 
33
- # Start the FastAPI application
34
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
+ # Install dependencies
6
+ COPY requirements.txt .
7
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
8
 
9
+ # Copy application
10
+ COPY app.py .
11
 
12
+ # Expose port (Hugging Face uses 7860)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  EXPOSE 7860
14
 
15
+ # Run FastAPI with uvicorn
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]