b2 / Dockerfile
MakPr016's picture
Update Dockerfile
f5a9043 verified
Raw
History Blame Contribute Delete
990 Bytes
# Use the official Ollama image as base — avoids all install/PATH issues
FROM ollama/ollama:latest
# ── System deps for Python ────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
curl \
&& rm -rf /var/lib/apt/lists/*
# ── Python API layer ──────────────────────────────────────────────────────────
WORKDIR /app
COPY requirements.txt .
RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt
COPY app.py .
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
# HF Spaces requires port 7860
EXPOSE 7860
ENV OLLAMA_HOST=0.0.0.0:11434
ENV OLLAMA_MODELS=/app/models
ENV MODEL_TAG=gemma4:12b-it-qat
ENV OLLAMA_FLASH_ATTENTION=1
ENTRYPOINT ["/app/entrypoint.sh"]