Move WORKDIR directive in Docker examples (#6652)

This commit is contained in:
Zanie Blue 2024-08-26 15:09:01 -05:00 committed by GitHub
parent a2290ff360
commit 330f5adf34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,9 +57,9 @@ If you're using uv to manage your project, you can copy it into the image and in
```dockerfile title="Dockerfile"
# Copy the project into the image
ADD . /app
WORKDIR /app
# Sync the project into a new environment, using the frozen lockfile
WORKDIR /app
RUN uv sync --frozen
```
@ -228,12 +228,14 @@ a big time saver.
FROM python:3.12-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Change the working directory to the `app` directory
WORKDIR /app
# Copy the lockfile and `pyproject.toml` into the image
ADD uv.lock /app/uv.lock
ADD pyproject.toml /app/pyproject.toml
# Install dependencies
WORKDIR /app
RUN uv sync --frozen --no-install-project
# Copy the project into the image