Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more documentation #3

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ An example project for using uv in Dockerfiles.

See the [uv Docker integration guide](https://docs.astral.sh/uv/guides/integration/docker/) for more details.

## Running the image
## Trying it out

A [`run.sh`](./run.sh) utility is provided for quickly building the image and starting a container.

Expand All @@ -28,3 +28,35 @@ To enter a `bash` shell in the image:
```
./run.sh /bin/bash
```

## Project overview

### Dockerfile

The [`Dockerfile`](./Dockerfile) defines the image and includes:

- Installation of uv
- Installing the project dependencies and the project separately for optimal image build caching
- Placing environment executables on the `PATH`

### Docker ignore file

The [`.dockerignore`](./.dockerignore) file includes an entry for the `.venv` directory to ensure the
`.venv` is not included in image builds. Note that the `.dockerignore` file is not applied to volume
mounts during container runs.

### Run script

The [run script](./run.sh) includes an example of invoking `docker run` for local development,
mounting the source code for the project into the container so that edits are reflected immediately.

### Application code

The Python application code for the project is at
[`src/uv_docker_example/__init__.py`](./src/uv_docker_example/__init__.py) — it just prints hello
world.

### Project definition

The project at [`pyproject.toml`](./pyproject.toml) includes includes Ruff as an example development
dependency and defines a `hello` entrypoint for the application.