resume-optimizer-api / Dockerfile
JermaineAI's picture
Move model download to runtime with auth
847ffb5
raw
history blame contribute delete
874 Bytes
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# 1. Install CPU-only PyTorch (Keep this!)
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
# 2. Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 3. FIX: Install spaCy model directly via URL instead of 'python -m spacy download'
# This ensures it gets the exact file without guessing the version
RUN pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1.tar.gz
COPY . .
# Change exposed port to 7860
EXPOSE 7860
# Run uvicorn on port 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]