Spaces:
Paused
Paused
| # Simple production Docker with Python 3.10 | |
| FROM python:3.10 | |
| # Environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| GRADIO_SERVER_NAME=0.0.0.0 \ | |
| GRADIO_SERVER_PORT=7860 | |
| # Create user | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Set paths | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| # Copy and install requirements | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy app | |
| COPY --chown=user app.py . | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run app | |
| CMD ["python", "app.py"] | |