ShamsKhan404 commited on
Commit
f4e484a
·
verified ·
1 Parent(s): 59c3a48

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -9
Dockerfile CHANGED
@@ -1,19 +1,28 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy all files to the container
8
  COPY . .
9
 
10
- # Install dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
12
 
13
- # Ensure compatible TensorFlow version
 
 
 
14
  RUN pip install tensorflow==2.12.0
15
- COPY ./model/hsmodel.h5 /app/model/hsmodel.h5
16
 
17
- # Expose port and run the application
18
  EXPOSE 7860
19
- CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "wsgi:app"]
 
 
 
1
+ # Use the official Python slim image
2
  FROM python:3.10-slim
3
 
4
+ # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Copy project files to the container
8
  COPY . .
9
 
10
+ # Install system dependencies
11
+ RUN apt-get update && apt-get install -y --no-install-recommends \
12
+ libglib2.0-0 \
13
+ libsm6 \
14
+ libxext6 \
15
+ libxrender-dev \
16
+ && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Install Python dependencies
19
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Ensure TensorFlow compatibility (match your local version explicitly)
22
  RUN pip install tensorflow==2.12.0
 
23
 
24
+ # Expose port 7860 (if required for your app)
25
  EXPOSE 7860
26
+
27
+ # Start the WSGI server
28
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "wsgi:app"]