FROM python:3.11-slim WORKDIR /app # Install git just in case any pip packages need it RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Download the English model RUN python -m spacy download en_core_web_sm # For Japanese (Ginza), you just need to make sure it's installed # (which happens via requirements.txt). No extra 'spacy download' is needed for ja-ginza. COPY . . # Hugging Face permissions fix RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app COPY --chown=user . $HOME/app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]