Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +18 -9
Dockerfile
CHANGED
|
@@ -1,19 +1,28 @@
|
|
| 1 |
-
#
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
-
# Install dependencies
|
| 11 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
#
|
|
|
|
|
|
|
|
|
|
| 14 |
RUN pip install tensorflow==2.12.0
|
| 15 |
-
COPY ./model/hsmodel.h5 /app/model/hsmodel.h5
|
| 16 |
|
| 17 |
-
# Expose port
|
| 18 |
EXPOSE 7860
|
| 19 |
-
|
|
|
|
|
|
|
|
|
| 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"]
|