Filerestricter / Dockerfile
Bilal-bhf-123's picture
Update Dockerfile
d7dad77 verified
FROM python:3.10-slim
WORKDIR /app
# Install minimal system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
libmagic1 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app.py .
# Create non-root user (optional but recommended)
RUN useradd -m -u 1000 user
USER user
# Expose port
EXPOSE 7860
# Run the application
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]