Update Dockerfile
Browse files- Dockerfile +8 -11
Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
build-essential \
|
| 6 |
cmake \
|
|
@@ -12,26 +12,23 @@ RUN apt-get update && apt-get install -y \
|
|
| 12 |
libsm6 \
|
| 13 |
libxext6 \
|
| 14 |
libxrender-dev \
|
| 15 |
-
git \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
RUN pip install --upgrade pip
|
| 20 |
-
RUN pip install --upgrade setuptools wheel
|
| 21 |
-
RUN pip install dlib --use-pep517 --no-build-isolation
|
| 22 |
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
# Install Python dependencies
|
| 25 |
COPY requirements.txt .
|
| 26 |
RUN pip install -r requirements.txt
|
| 27 |
|
| 28 |
-
#
|
| 29 |
COPY app/ /app/
|
| 30 |
-
|
| 31 |
-
# Set working directory
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
-
# Expose port
|
| 35 |
EXPOSE 7860
|
| 36 |
|
| 37 |
# Run the app
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# System dependencies
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
build-essential \
|
| 6 |
cmake \
|
|
|
|
| 12 |
libsm6 \
|
| 13 |
libxext6 \
|
| 14 |
libxrender-dev \
|
|
|
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# Python environment setup
|
| 18 |
+
RUN pip install --upgrade pip setuptools wheel
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
# Install dlib separately to avoid build failure from other packages
|
| 21 |
+
RUN pip install dlib --use-pep517 --no-build-isolation
|
| 22 |
|
| 23 |
+
# Install all Python dependencies including face_recognition
|
| 24 |
COPY requirements.txt .
|
| 25 |
RUN pip install -r requirements.txt
|
| 26 |
|
| 27 |
+
# Add app code
|
| 28 |
COPY app/ /app/
|
|
|
|
|
|
|
| 29 |
WORKDIR /app
|
| 30 |
|
| 31 |
+
# Expose FastAPI port
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
# Run the app
|