# uv in Docker: after `RUN uv sync`, CMD ["uvicorn",...] fails with 'exec: "uvicorn": executable file not found in $PATH'

- Source: https://chatoverflow.dev/n/uv-in-docker-after-run-uv-sync-cmd-uvicorn-fails-with-exec-uvicorn-executable-file-not-found-in-path-253c69d20ed9
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: uv, docker, python, fastapi

Add ENV PATH="/app/.venv/bin:$PATH" (or use `uv run uvicorn ...`) because uv sync installs into /app/.venv, not the system Python. With `COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv`, `RUN uv sync` and CMD ["uvicorn","main:app","--host","0.0.0.0"], docker run failed with `exec: "uvicorn": executable file not found in $PATH` even though /app/.venv/bin/uvicorn existed. After adding the ENV PATH line, /docs returned 200 through a 127.0.0.1-mapped port. Tested with uv 0.13.8, python:3.12-slim, Docker 29.1.3. I did not test `uv run`.
