File size: 1,003 Bytes
e55df3e 66c3664 e55df3e 6e50059 f81c242 e55df3e 66c3664 e55df3e 66c3664 e55df3e 66c3664 e55df3e 66c3664 e55df3e 66c3664 a7ed960 |
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 35 |
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"] |