Spaces:
Sleeping
Sleeping
| FROM python:3.9 | |
| # Create a non-root user | |
| RUN useradd -m -u 1000 user | |
| # Set environment variables | |
| ENV HOME=/home/user | |
| ENV HF_HOME=$HOME/.cache/huggingface | |
| ENV TRANSFORMERS_CACHE=$HF_HOME | |
| # Set working directory | |
| WORKDIR $HOME/app | |
| # Copy and install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application files | |
| COPY --chown=user . . | |
| # Change to non-root user | |
| USER user | |
| # Expose the Streamlit port | |
| EXPOSE 8501 | |
| # Run the Streamlit app | |
| CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] | |