Spaces:
Sleeping
Sleeping
File size: 576 Bytes
5754a38 86fffcf 512e3e3 5754a38 86fffcf 5754a38 86fffcf 5754a38 86fffcf 5754a38 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
FROM python:3.9-slim
# Install system dependencies first as root
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc python3-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy requirements first for caching
COPY requirements.txt .
# Install Python dependencies system-wide
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY . .
# Create non-root user and set permissions
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |