Include uvx installation in Docker examples (#8179)

closes #7947
This commit is contained in:
Aditya Pratap Singh 2024-10-14 23:53:11 +05:30 committed by GitHub
parent da7ffd3357
commit 05446cd736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -74,7 +74,7 @@ official distroless Docker image:
```dockerfile title="Dockerfile"
FROM python:3.12-slim-bookworm
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
```
Or, with the installer:
@ -100,7 +100,7 @@ Note this requires `curl` to be available.
In either case, it is best practice to pin to a specific uv version, e.g., with:
```dockerfile
COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /uvx /bin/
```
Or, with the installer:
@ -342,7 +342,7 @@ a big time saver.
```dockerfile title="Dockerfile"
# Install uv
FROM python:3.12-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Change the working directory to the `app` directory
WORKDIR /app
@ -388,7 +388,7 @@ For example:
```dockerfile title="Dockerfile"
# Install uv
FROM python:3.12-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Change the working directory to the `app` directory
WORKDIR /app

View file

@ -96,7 +96,7 @@ To deploy the FastAPI application with Docker, you can use the following `Docker
FROM python:3.12-slim
# Install uv.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Copy the application into the container.
COPY . /app