Update Dockerfile
Browse files- Dockerfile +12 -3
Dockerfile
CHANGED
@@ -2,25 +2,34 @@ FROM python:3.9-slim
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
# Install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
build-essential \
|
8 |
curl \
|
9 |
git \
|
10 |
-
# --- OpenCV System Dependencies ---
|
11 |
libgl1-mesa-glx \
|
12 |
libglib2.0-0 \
|
13 |
libsm6 \
|
14 |
libxext6 \
|
15 |
&& rm -rf /var/lib/apt/lists/*
|
16 |
|
|
|
17 |
COPY requirements.txt ./
|
|
|
|
|
|
|
|
|
18 |
COPY src/ ./src/
|
|
|
19 |
|
20 |
-
|
|
|
|
|
|
|
21 |
|
22 |
EXPOSE 8501
|
23 |
|
24 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
25 |
|
|
|
26 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
# Install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
build-essential \
|
8 |
curl \
|
9 |
git \
|
|
|
10 |
libgl1-mesa-glx \
|
11 |
libglib2.0-0 \
|
12 |
libsm6 \
|
13 |
libxext6 \
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
16 |
+
# Install Python requirements first for better caching
|
17 |
COPY requirements.txt ./
|
18 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
19 |
+
|
20 |
+
# --- CORRECTED FILE COPYING ---
|
21 |
+
# Copy the entire 'src' directory, which contains both the app and the model
|
22 |
COPY src/ ./src/
|
23 |
+
# The separate 'COPY rssi_last.pt ./' line is now removed as it's not needed.
|
24 |
|
25 |
+
# Create and use a non-root user to solve Permission Errors
|
26 |
+
RUN useradd -ms /bin/bash -d /app appuser
|
27 |
+
RUN chown -R appuser:appuser /app
|
28 |
+
USER appuser
|
29 |
|
30 |
EXPOSE 8501
|
31 |
|
32 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
33 |
|
34 |
+
# The entrypoint remains the same
|
35 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|