Spaces:
Paused
Paused
| FROM python:3.12-slim | |
| # Create non-root user | |
| RUN useradd -m -s /bin/bash user | |
| # Install system dependencies as root | |
| RUN apt-get update && \ | |
| apt-get install -y libreoffice ffmpeg && \ | |
| apt-get clean && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Switch to non-root user AFTER installing system packages | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| COPY --chown=user ./ $HOME/app | |
| # Install Python dependencies as non-root | |
| RUN pip install --trusted-host pypi.python.org -r requirements.txt | |
| EXPOSE 7860 | |
| ENV NAME World | |
| ENV NUMBA_CACHE_DIR=/tmp/numba_cache | |
| ENV NUMBA_DISABLE_JIT=0 | |
| CMD ["python", "app.py"] | |