From 1cbd22991c9c515ba63f24574ce9e83e94d54aaa Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Thu, 20 Aug 2026 18:55:16 +0200 Subject: [PATCH] fix(docker): keep the YOLO weights in the workdir as before YOLO_MODEL_PATH stays available for deployments that need it, but the image no longer sets it, so the default behavior is identical to what every existing deploy already runs. --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6bbf860..7fc111d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,11 +102,8 @@ RUN chown -R appuser:appuser /app /tmp/Ultralytics # Switch to non-root user USER appuser -# Pre-download YOLO model on build (now running as appuser). Baked into -# /tmp/Ultralytics instead of the workdir so a volume mounted over /app can't -# shadow it and force a re-download at startup. -ENV YOLO_MODEL_PATH=/tmp/Ultralytics/yolov8n.pt -RUN python -c "from ultralytics import YOLO; YOLO('/tmp/Ultralytics/yolov8n.pt')" +# Pre-download YOLO model on build (now running as appuser) +RUN python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')" # Expose FastAPI port EXPOSE 8000