FROM ultralytics/ultralytics:latest # The ultralytics image already has python, system dependencies, PyTorch, TensorRT, and ultralytics installed. # We just need to install uv and our project dependencies. # Pin the installer RUN pip install --no-cache-dir uv==0.10.6 # Set working directory WORKDIR /workspace ENV ULTRALYTICS_SAFE_LOAD=1 # Keep the training/GPU stack supplied by the Ultralytics image, while installing # the remaining application dependencies at the exact versions recorded in uv.lock. COPY pyproject.toml uv.lock README.md ./ RUN --mount=type=cache,target=/root/.cache/uv \ uv export --locked --no-dev --group build --no-emit-project --prune ultralytics \ --output-file /tmp/requirements.lock && \ uv pip install --system --requirement /tmp/requirements.lock # Copy source code and install only the project itself without re-resolving deps. COPY src ./src RUN uv pip install --system --no-deps --no-build-isolation . # Expose Web UI port and MLflow port EXPOSE 8000 EXPOSE 5000 # Start Web UI using the system entry point CMD ["yolo-train-webui", "--host", "0.0.0.0", "--port", "8000"]