Update Dockerfile
Browse files- Dockerfile +6 -6
Dockerfile
CHANGED
@@ -15,20 +15,20 @@ RUN pip3 install --no-cache-dir -r requirements.txt
|
|
15 |
# Copy ALL your application files from the root into the container's /app directory
|
16 |
COPY . .
|
17 |
|
18 |
-
# --- NEW FIX for the Ultralytics Warning ---
|
19 |
-
# Create the .config directory so Ultralytics can write to it.
|
20 |
-
RUN mkdir -p /app/.config
|
21 |
-
|
22 |
# --- User and Permission Setup ---
|
23 |
# Create a group and user
|
24 |
RUN groupadd --system appuser && useradd --system --gid appuser appuser
|
25 |
|
26 |
-
# Change ownership of the entire app directory
|
27 |
RUN chown -R appuser:appuser /app
|
28 |
|
29 |
# Set the HOME environment variable for the user
|
30 |
ENV HOME=/app
|
31 |
|
|
|
|
|
|
|
|
|
32 |
# Switch to the non-root user
|
33 |
USER appuser
|
34 |
# --- End of User Setup ---
|
@@ -37,5 +37,5 @@ EXPOSE 8501
|
|
37 |
|
38 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
39 |
|
40 |
-
# Run the streamlit app
|
41 |
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false"]
|
|
|
15 |
# Copy ALL your application files from the root into the container's /app directory
|
16 |
COPY . .
|
17 |
|
|
|
|
|
|
|
|
|
18 |
# --- User and Permission Setup ---
|
19 |
# Create a group and user
|
20 |
RUN groupadd --system appuser && useradd --system --gid appuser appuser
|
21 |
|
22 |
+
# Change ownership of the entire app directory to the user
|
23 |
RUN chown -R appuser:appuser /app
|
24 |
|
25 |
# Set the HOME environment variable for the user
|
26 |
ENV HOME=/app
|
27 |
|
28 |
+
# --- NEW: Tell Ultralytics to use the /tmp directory for its config ---
|
29 |
+
# This is the cleanest way to solve the "not writeable" warning.
|
30 |
+
ENV YOLO_CONFIG_DIR=/tmp
|
31 |
+
|
32 |
# Switch to the non-root user
|
33 |
USER appuser
|
34 |
# --- End of User Setup ---
|
|
|
37 |
|
38 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
39 |
|
40 |
+
# Run the streamlit app.
|
41 |
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false"]
|