Spaces:
Sleeping
Sleeping
FROM python:3.10-slim | |
# Set working directory in the container | |
WORKDIR /app | |
# Copy requirements and install dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Create non-root user for HF Spaces and make /app writable | |
RUN adduser --disabled-password --gecos '' --uid 1000 --gid 1000 user && chown -R user:user /app | |
# Copy application files | |
COPY . . | |
# Expose Streamlit port | |
EXPOSE 8501 | |
# Health check for Streamlit | |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1 | |
# Run Streamlit as the non-root user | |
CMD ["streamlit", "run", "frontend.py", "--server.port=8501", "--server.address=0.0.0.0"] |