Spaces:
Runtime error
Runtime error
File size: 830 Bytes
ef8903e | 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 33 34 | FROM python:3.10-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PORT=7860 \
HOME=/home/user
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user with UID 1000
RUN useradd -m -u 1000 user
# Set up working directory inside home for proper permissions
WORKDIR $HOME/app
# Copy requirements first to leverage Docker cache
COPY requirements.txt $HOME/app/
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files (including main.py, saved_hybrid_model, deberta_model)
COPY --chown=user:user . $HOME/app
# Expose port 7860 (HuggingFace default)
EXPOSE 7860
# Command to run uvicorn
CMD ["python", "main.py"]
|