FROM python:3.9-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ gcc \ libasound2-dev \ espeak \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Copy requirements first to leverage Docker cache COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Download spaCy model RUN python -m spacy download en_core_web_sm # Copy application code COPY . . # Create upload directory RUN mkdir -p uploads # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV PORT=5000 ENV HF_MODEL="mistralai/Mistral-7B-Instruct-v0.2" # Expose the port the app runs on EXPOSE 5000 # Command to run the application CMD ["python", "app.py"]