mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Move WORKDIR
directive in Docker examples (#6652)
This commit is contained in:
parent
a2290ff360
commit
330f5adf34
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue