File size: 854 Bytes
b46239f 49df561 b46239f 49df561 b46239f 49df561 b46239f 49df561 b46239f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# Python deps
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# App source
COPY . .
# ---------------------------------------------------------------------------
# Runtime environment — model is downloaded on first startup using HF_TOKEN
# secret set in Space settings (Spaces secrets are NOT available at build time)
# ---------------------------------------------------------------------------
ENV MODEL_ID=gsstec/LFM2-700M
ENV HF_HOME=/app/model_cache
ENV TRANSFORMERS_CACHE=/app/model_cache
ENV HF_HUB_DISABLE_PROGRESS_BARS=1
# HuggingFace Spaces runs as uid 1000
RUN useradd -m -u 1000 user && chown -R user /app
USER user
EXPOSE 7860
CMD ["python", "app.py"]
|