ganeshkonapalli commited on
Commit
c5f0525
·
verified ·
1 Parent(s): f720173

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official Python slim image
2
+ FROM python:3.10-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE 1
6
+ ENV PYTHONUNBUFFERED 1
7
+
8
+ # Set working directory
9
+ WORKDIR /code
10
+
11
+ # Install dependencies (libgomp is required for XGBoost)
12
+ RUN apt-get update && \
13
+ apt-get install -y libgomp1 && \
14
+ rm -rf /var/lib/apt/lists/*
15
+
16
+ # Copy requirements and install Python packages
17
+ COPY requirements.txt .
18
+ RUN pip install --upgrade pip && pip install -r requirements.txt
19
+
20
+ # Copy app files
21
+ COPY . .
22
+
23
+ # Expose port
24
+ EXPOSE 7860
25
+
26
+ # Run FastAPI app with Uvicorn
27
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]