File size: 960 Bytes
458d029 b2fe9ea 458d029 b2fe9ea 458d029 ed43b51 458d029 4b62f0a 458d029 df3738c 458d029 df3738c b2fe9ea 458d029 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# Use an image with Python and build tools pre-installed
FROM python:3.10-slim
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies for dlib and face_recognition
RUN apt-get update && \
apt-get install -y \
build-essential \
cmake \
gfortran \
libopenblas-dev \
liblapack-dev \
libx11-dev \
libgtk-3-dev \
libboost-python-dev \
libboost-thread-dev \
libboost-system-dev \
python3-dev \
wget \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy only requirements first to cache dependencies
COPY requirements.txt .
# Install Python dependencies (includes face_recognition and FastAPI)
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy the entire app
COPY . .
# Expose the app port
EXPOSE 7860
# Run the FastAPI app using uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|