Prayesh007/perceptionX-python
0
1# Use the official lightweight Python image2FROM python:3.10-slim3 4# Set working directory5WORKDIR /app6 7# Install system dependencies8RUN apt-get update && apt-get install -y \9 build-essential \10 ffmpeg \11 libsm6 \12 libxext6 \13 git \14 && rm -rf /var/lib/apt/lists/*15 16# Copy requirements.txt first (for caching)17COPY requirements.txt .18 19# Upgrade pip and install dependencies20RUN pip install --upgrade pip && \21 pip install --no-cache-dir -r requirements.txt22 23# Copy the rest of the app (including .env)24COPY . .25 26# Make sure python-dotenv is available27RUN pip install python-dotenv28 29# Environment variables30ENV PYTHONUNBUFFERED=131 32# Expose port (Hugging Face will map it automatically)33EXPOSE 786034 35# Start FastAPI with uvicorn36CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]37 