rishab1090 commited on
Commit
18788eb
·
verified ·
1 Parent(s): 204e078

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -11
Dockerfile CHANGED
@@ -1,11 +1,14 @@
1
- # Use an official Python runtime
2
  FROM python:3.10-slim
3
 
4
- # Avoids .pyc files
 
 
 
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
  ENV PYTHONUNBUFFERED=1
7
 
8
- # Install dependencies
9
  RUN apt-get update && apt-get install -y \
10
  build-essential \
11
  libglib2.0-0 \
@@ -15,15 +18,18 @@ RUN apt-get update && apt-get install -y \
15
  libgl1 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # Set workdir
19
- WORKDIR /app
20
 
21
- # Copy requirements and install
22
- COPY requirements.txt .
23
- RUN pip install --no-cache-dir -r requirements.txt
24
 
25
- # Copy the app code
26
- COPY . .
 
 
 
 
27
 
28
- # Run the app
29
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use a lightweight Python base image
2
  FROM python:3.10-slim
3
 
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Avoid Python writing .pyc files
8
  ENV PYTHONDONTWRITEBYTECODE=1
9
  ENV PYTHONUNBUFFERED=1
10
 
11
+ # Install required system dependencies
12
  RUN apt-get update && apt-get install -y \
13
  build-essential \
14
  libglib2.0-0 \
 
18
  libgl1 \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
+ # Copy all project files including 2.keras
22
+ COPY . .
23
 
24
+ # Set permissions for all files
25
+ RUN chmod -R 755 /app
 
26
 
27
+ # Install Python dependencies
28
+ RUN pip install --no-cache-dir --upgrade pip \
29
+ && pip install --no-cache-dir -r requirements.txt
30
+
31
+ # Expose port if needed (e.g., 7860 or 8000)
32
+ EXPOSE 7860
33
 
34
+ # Start the app with Uvicorn
35
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]