Skip to content

Conversation

@stefanotroncaro
Copy link
Contributor

@stefanotroncaro stefanotroncaro commented Dec 24, 2025

This PR updates:

  • package manager to uv
  • project configuration and lock file
  • Dockerfile and docker-compose configuration
  • documentation

Regarding the Dockerfile

It was adapted from the uv docker example repository.

[!WARN]
The original follows the security practice of running the application as a nonroot user. This caused problems with celery beat that, to fix, require changes outside of the scope of this PR.
This could be a good followup task.

Dev dependencies are only installed when RUN_ENV is set to local, so tests can be run on the application container. I can adapt the testing pipeline so that pytest can hit the test db from the local shell, to 1) simplify how tests are run, 2) make the app image generation faster and the end result lighter. Leave a comment requesting that change if it is desirable.

There are other Dockerfile examples, particularly, a multi-stage build that creates a smaller final image. I did not use that as basis, but it can be used if deemed useful. Leave a comment to request that change if it is desirable.

Regarding the docker-compose configuration

Now uses healthchecks to wait until the db container is ready until the api is started. This renders the api_pre_start.py script useless, so I removed it.

The watch feature is used to sync local changes to the container, which is a modern alternative to mounting the project directory on the app workdir. The same feature is also used to automatically rebuild and remount the image if changes are made to dependencies or the .env file.

@stefanotroncaro stefanotroncaro changed the title build: use uv as package manager Change package manager to uv Dec 24, 2025
@stefanotroncaro stefanotroncaro marked this pull request as ready for review December 30, 2025 15:22
1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/) using the command below, or one of other the methods listed in the `uv` documentation

```bash
brew install uv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we attach the installation to brew knowing that is mac specific? I'm ok but just wanted to bring it to the table

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good point. Perhaps we should just offer the link to the uv installation instructions and let the user decide?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants