FROM python:3.9-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ libgl1-mesa-glx \ libglib2.0-0 \ libsm6 \ libxext6 \ && rm -rf /var/lib/apt/lists/* # Install Python requirements first for better caching COPY requirements.txt ./ RUN pip3 install --no-cache-dir -r requirements.txt # --- CORRECTED FILE COPYING --- # Copy the entire 'src' directory, which contains both the app and the model COPY src/ ./src/ # The separate 'COPY rssi_last.pt ./' line is now removed as it's not needed. # Create and use a non-root user to solve Permission Errors RUN useradd -ms /bin/bash -d /app appuser RUN chown -R appuser:appuser /app USER appuser EXPOSE 8501 HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health # The entrypoint remains the same ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]