Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +4 -17
Dockerfile
CHANGED
|
@@ -1,33 +1,20 @@
|
|
| 1 |
-
# Use the official Python image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
libglib2.0-0 \
|
| 10 |
libsm6 \
|
| 11 |
libxext6 \
|
| 12 |
libxrender-dev \
|
| 13 |
-
libgl1 \
|
| 14 |
-
ffmpeg \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
# Copy requirements first to leverage Docker cache
|
| 18 |
-
COPY requirements.txt ./
|
| 19 |
-
|
| 20 |
-
# Install Python dependencies
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
-
# Copy the model to the correct location inside the container
|
| 24 |
-
COPY model/RAFDB_Custom.h5 /app/model/RAFDB_Custom.h5
|
| 25 |
-
|
| 26 |
-
# Copy the rest of the application files
|
| 27 |
COPY . .
|
| 28 |
|
| 29 |
-
|
| 30 |
-
EXPOSE 7860
|
| 31 |
|
| 32 |
-
|
| 33 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
COPY requirements.txt ./
|
| 6 |
+
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
libglib2.0-0 \
|
| 9 |
libsm6 \
|
| 10 |
libxext6 \
|
| 11 |
libxrender-dev \
|
|
|
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
COPY . .
|
| 17 |
|
| 18 |
+
EXPOSE 5000
|
|
|
|
| 19 |
|
| 20 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "wsgi:app"]
|
|
|