Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files1 unmodified line2345678910111213141516171819202122232425261 unmodified lineWORKDIR /app# Copy requirements first for better cachingCOPY requirements.txt .# Install system dependencies if neededRUN apt-get update && apt-get install -y \build-essential \&& rm -rf /var/lib/apt/lists/*# Install Python dependenciesRUN pip install --no-cache-dir -r requirements.txt# Copy the rest of the applicationCOPY . .# Expose the portEXPOSE 8501# Health checkHEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health# Run the applicationCMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]1 unmodified line2345678910111213141516171819202122232425262728293031321 unmodified lineWORKDIR /app# Install system dependenciesRUN apt-get update && apt-get install -y \build-essential \curl \&& rm -rf /var/lib/apt/lists/*# Copy requirements and install Python packagesCOPY requirements.txt .RUN pip install --upgrade pipRUN pip install --no-cache-dir -r requirements.txt# Verify streamlit is installed and accessibleRUN which streamlitRUN streamlit --version# Copy application codeCOPY . .# Create a non-root user (optional but recommended)RUN useradd --create-home --shell /bin/bash appuserRUN chown -R appuser:appuser /appUSER appuser# Expose portEXPOSE 7860# Command to run the applicationCMD ["python", "-m", "streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]
Dockerfile+18-12