Spaces:
Sleeping
Sleeping
File size: 592 Bytes
cd3f41e 8967d6a cd3f41e 8967d6a cd3f41e 8967d6a cd3f41e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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"] |