sahil239 commited on
Commit
6c2c9b1
·
verified ·
1 Parent(s): f5179c6

Create DockerFile

Browse files
Files changed (1) hide show
  1. DockerFile +28 -0
DockerFile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python base image
2
+ FROM python:3.10-slim
3
+
4
+ # Install system dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ git \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Set environment variables
10
+ ENV PYTHONDONTWRITEBYTECODE=1
11
+ ENV PYTHONUNBUFFERED=1
12
+ ENV HF_HOME=/app/hf_cache
13
+
14
+ # Set working directory
15
+ WORKDIR /app
16
+
17
+ # Copy requirements and install
18
+ COPY requirements.txt .
19
+ RUN pip install --upgrade pip && pip install -r requirements.txt
20
+
21
+ # Copy the rest of the app code
22
+ COPY . .
23
+
24
+ # Expose the port Hugging Face expects
25
+ EXPOSE 7860
26
+
27
+ # Run FastAPI with uvicorn on port 7860
28
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]