FROM python:3.9-slim # System dependencies required for Python packages RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ gcc \ curl \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Install blis and googletrans separately to avoid building from source RUN pip install --no-cache-dir --prefer-binary \ blis==0.7.9 \ googletrans==4.0.0rc1 # Copy requirements and install remaining dependencies COPY requirements.txt . RUN pip install --no-cache-dir --prefer-binary -r requirements.txt # Download spaCy model RUN python -m spacy download en_core_web_sm # Copy your application COPY . . # Expose required port EXPOSE 7860 # Flask environment config ENV FLASK_APP=app.py ENV FLASK_RUN_PORT=7860 ENV FLASK_RUN_HOST=0.0.0.0 # Run the Flask server CMD ["flask", "run"]