| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install uv for faster package installation | |
| RUN pip install uv | |
| # Copy requirements and install dependencies | |
| COPY requirements.txt . | |
| RUN uv pip install --system -r requirements.txt | |
| # Copy the app | |
| COPY app.py . | |
| # Create non-root user for security | |
| RUN useradd -m -u 1000 user | |
| # Create marimo cache directory with correct permissions | |
| RUN mkdir -p /app/__marimo__ && chown -R user:user /app | |
| USER user | |
| # Expose port 7860 (HuggingFace Spaces default) | |
| EXPOSE 7860 | |
| # Run the marimo app | |
| CMD ["marimo", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"] | |