Novelt / Dockerfile
Ruhivig65's picture
Upload 6 files
6cc0372 verified
raw
history blame contribute delete
590 Bytes
FROM python:3.10.14-slim
# Create non-root user (HuggingFace requirement)
RUN useradd -m -u 1000 appuser
WORKDIR /app
# Install dependencies first (Docker cache optimization)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all application code
COPY . .
# Create necessary directories with proper permissions
RUN mkdir -p uploads outputs && \
chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
# HuggingFace Spaces expects port 7860
EXPOSE 7860
# Launch command
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]