Spaces:
Sleeping
Sleeping
FROM python:3.10-slim | |
WORKDIR /app | |
# Install system packages as root | |
RUN apt-get update && \ | |
apt-get install -y redis-server && \ | |
rm -rf /var/lib/apt/lists/* | |
# Copy and install Python requirements | |
COPY requirements.txt /app/ | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy application code | |
COPY . /app/ | |
# Create non-root user and set permissions | |
RUN useradd -m -u 1000 user && \ | |
chown -R user:user /app | |
# Switch to non-root user | |
USER user | |
CMD ["/bin/bash", "-c", "redis-server --daemonize yes && streamlit run main.py --server.port=7860 --server.address=0.0.0.0"] |