samchun-gemini / Dockerfile
JHyeok5's picture
Upload folder using huggingface_hub
b0cc8a3 verified
raw
history blame contribute delete
621 Bytes
FROM python:3.11-slim
# Build version: 2026-03-03-v12 (restore HF Spaces uid 1000 pattern)
ENV PYTHONUNBUFFERED=1
# Create non-root user (HF Spaces runs containers with --user 1000)
RUN useradd -m -u 1000 user
# Install dependencies as root first
WORKDIR /home/user/app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY --chown=user . .
# Switch to non-root user
USER user
# Expose port (HuggingFace Spaces uses 7860)
EXPOSE 7860
# Run the application
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]