s3-api / Dockerfile
WaysAhead Global
Update Dockerfile
f4391df verified
Raw History Blame Contribute Delete
1.03 kB
# Use official Python image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEEPFACE_HOME=/app/.deepface
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libpoppler-cpp-dev \
poppler-utils \
ffmpeg \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create writable directories
RUN mkdir -p /app/.deepface /app/persistent_vector_store && chmod -R 777 /app
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Download spaCy model
RUN python -m spacy download en_core_web_sm
# Copy app files
COPY . .
# Expose FastAPI port
EXPOSE 7860
# Start the app (ensure your file is named app.py and contains app = FastAPI())
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]