LisaMegaWatts's picture
Upload Dockerfile with huggingface_hub
18c68e7 verified
raw
history blame contribute delete
679 Bytes
FROM python:3.11-slim
# HuggingFace Spaces requires user ID 1000
RUN useradd -m -u 1000 user
WORKDIR /home/user/app
# Install dependencies (CPU-only torch to keep image small)
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt \
--extra-index-url https://download.pytorch.org/whl/cpu
# Copy application code
COPY --chown=user juliaslm_svd_model.py .
COPY --chown=user server.py .
# Create checkpoints directory (model downloads from HF at runtime)
RUN mkdir -p /home/user/app/checkpoints && chown user:user /home/user/app/checkpoints
# Switch to non-root user
USER user
ENV HOME=/home/user
EXPOSE 7860
CMD ["python", "server.py"]