bhoomika19 commited on
Commit
2d5c53b
·
verified ·
1 Parent(s): a3f2438

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -18
Dockerfile CHANGED
@@ -1,18 +1,28 @@
1
- # Use official Python image
2
- FROM python:3.10-slim
3
-
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Copy requirements from backend and install
8
- COPY backend/requirements.txt .
9
- RUN pip install --no-cache-dir -r requirements.txt
10
-
11
- # Copy the backend code
12
- COPY backend/ .
13
-
14
- # Expose the port your FastAPI app runs on
15
- EXPOSE 7860
16
-
17
- # Command to run the FastAPI app
18
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official Python image with a more recent version
2
+ FROM python:3.11-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ gcc \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy requirements from backend and install
13
+ COPY backend/requirements.txt .
14
+
15
+ # Upgrade pip to latest version to resolve dependency conflicts better
16
+ RUN pip install --upgrade pip
17
+
18
+ # Install Python dependencies
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Copy the backend code
22
+ COPY backend/ .
23
+
24
+ # Expose the port your FastAPI app runs on
25
+ EXPOSE 7860
26
+
27
+ # Command to run the FastAPI app
28
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]