Spaces:
Running
Running
File size: 814 Bytes
465b605 f26a55e 3816ab6 f26a55e ac834d0 f26a55e ac834d0 4c7365e ac834d0 4c7365e ac834d0 f26a55e ac834d0 3816ab6 ac834d0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
FROM python:3.12.11-slim
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy only requirements first for caching
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Add non-root user for security
RUN useradd -ms /bin/bash appuser
# Copy application files
COPY . .
# Create .streamlit config dir with correct permissions
RUN mkdir -p /app/.streamlit && chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
# Ensure PATH includes user-installed binaries (like streamlit)
ENV PATH=$PATH:/home/appuser/.local/bin
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|