Use UV to manage python dependencies
Description
This PR adds uv as package manager for the api Python app.
Dockerfile has been refactored to be multi-stage as well as producing "production", "dev" and "test" images
Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Feature (non-breaking change which adds functionality)
- [X] Improvement (change that would cause existing functionality to not work as expected)
- [ ] Code refactoring
- [ ] Performance improvements
- [ ] Documentation update
Screenshots and Media (if applicable)
Test Scenarios
Built application, verified it's running
References
[!NOTE] Switch API to uv-managed pyproject and multi-stage Dockerfile, update CI to use new Dockerfile, and remove legacy requirements/Dockerfiles.
- Backend/API:
- Replace legacy
Dockerfile.api/Dockerfile.devwith a multi-stageapps/api/Dockerfileleveraginguvand dependency caching; addapps/api/.dockerignore.- Move dependencies to
apps/api/pyproject.toml(runtime + local/test groups); removerequirements*files.- CI:
- Update
.github/workflows/build-branch.ymlto build API usingapps/api/Dockerfile.Written by Cursor Bugbot for commit 4e0316f69c7946931640597d3f10d0bf8cc5b2ac. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
- Chores
- Consolidated container build into a single multi-stage image for dev, test, and production and added ignore patterns to slim build contexts.
- Removed legacy container variants and cleared legacy dependency manifests, simplifying dependency management.
- Updated project metadata and bumped version to v1.21.1.
- CI and deployment build pipelines updated to use the new container build layout.
โ๏ธ Tip: You can customize this high-level summary in your review settings.
[!NOTE]
Other AI code review bot(s) detected
CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.
Walkthrough
Consolidates API Docker build into a single multi-stage apps/api/Dockerfile, removes legacy API Dockerfiles and several requirements manifests, adds apps/api/.dockerignore, updates pyproject.toml, and updates CI/deploy/docker-compose references from Dockerfile.api to Dockerfile.
Changes
| Cohort / File(s) | Change Summary |
|---|---|
Unified API Dockerfile apps/api/Dockerfile, apps/api/Dockerfile.api, apps/api/Dockerfile.dev |
Added a new multi-stage apps/api/Dockerfile (builder/dev/test/prod stages); deleted apps/api/Dockerfile.api and apps/api/Dockerfile.dev. |
Docker context ignore apps/api/.dockerignore |
Added .dockerignore entries: venv/, .venv/, and Dockerfile. |
Dependency manifest migration apps/api/pyproject.toml, apps/api/requirements.txt, apps/api/requirements/* |
Updated pyproject.toml (project name/version/description, requires-python, expanded dependencies, added [dependency-groups]); emptied or removed apps/api/requirements.txt and files under apps/api/requirements/ (base.txt, local.txt, production.txt, test.txt). |
CI & deployment references .github/workflows/build-branch.yml, deployments/cli/community/build.yml, docker-compose.yml |
Replaced Dockerfile paths for API builds from Dockerfile.api to Dockerfile; build contexts unchanged. |
Estimated code review effort
๐ฏ 4 (Complex) | โฑ๏ธ ~45 minutes
- Inspect
apps/api/Dockerfilemulti-stage COPY/WORKDIR/USER steps and file ownership/permissions. - Verify
./bin/docker-entrypoint-api.shand any referenced scripts are present and executable. - Ensure dependencies moved into
pyproject.tomlcover required runtime and dev/test tooling previously in requirements files. - Confirm
.dockerignoredoes not exclude files the new Dockerfile needs (notablyDockerfileis ignored). - Check CI and docker-compose changes for any remaining references to deleted Dockerfile variants.
Poem
๐ I hopped through layers, merged stages with delight,
Old Dockerfiles tucked away, a single one in sight,
Toml pages updated, dependencies in line,
CI points to the new path and builds hum just fine,
A little rabbit cheers โ containers take flight!
Pre-merge checks and finishing touches
โ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | โ Passed | The title 'Use UV to manage python dependencies' clearly and concisely summarizes the primary change: migrating to uv as the Python package manager for the API. |
| Description check | โ Passed | The description covers the main changes (uv adoption, multi-stage Dockerfile, dependency consolidation), includes the required Type of Change selection, provides test verification, and adds supplementary context via cursor summary. |
| Docstring Coverage | โ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
โจ Finishing touches
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
๐ Recent review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
๐ฅ Commits
Reviewing files that changed from the base of the PR and between a8071acdc92913ff734ed8ab9665f6027706a0fb and 4e0316f69c7946931640597d3f10d0bf8cc5b2ac.
๐ Files selected for processing (1)
apps/api/Dockerfile
๐งฐ Additional context used
๐ง Learnings (1)
๐ Learning: 2025-11-25T10:17:39.709Z
Learnt from: CR
Repo: makeplane/plane PR: 0
File: .github/instructions/bash.instructions.md:0-0
Timestamp: 2025-11-25T10:17:39.709Z
Learning: Applies to docker-compose.yml : Use docker-compose.yml for production and staging Docker configuration
Applied to files:
apps/api/Dockerfile
โฐ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cursor Bugbot
๐ Additional comments (3)
apps/api/Dockerfile (3)
1-43: Excellent multi-stage build structure!The builder-with-tools stage is well-designed:
- uv version is pinned for reproducibility
- System dependencies are properly separated into build-time and runtime packages
- Cache mounts optimize dependency installation
- PYTHONUNBUFFERED is correctly set for container logging
- Layer ordering (dependencies before project copy) maximizes cache efficiency
Previous concerns about missing runtime libraries (libpq, libxslt, xmlsec), bash, and PATH configuration have all been addressed.
45-61: Dev, test, and builder stages are correctly structured.The stage inheritance is optimal:
devandtestinherit frombuilder-with-tools(retaining build dependencies for compiling packages with native extensions)builderremoves build dependencies after inheriting frombuilder-with-tools- This ensures dev/test can compile packages while keeping production lean
64-70: Entrypoint script already uses production-ready server.The
./bin/docker-entrypoint-api.shalready executes gunicorn with uvicorn workers for async ASGI support (line 38), not Django's development server. The configuration includes proper worker settings, request limits, and access logging, making it production-ready.Likely an incorrect or invalid review comment.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.