Fix/docker build issues#707
Conversation
- Add missing system dependencies (pkg-config, default-libmysqlclient-dev, build-essential) for MySQL client compilation - Fix Poetry package configuration by removing problematic package inclusion - Reorder superuser creation to occur after test data creation to prevent user clearing - Set superuser password properly during Docker build process Resolves MySQL client build failures and Poetry package installation errors
- Replace hardcoded 'adminpassword' with os.environ['DJANGO_SUPERUSER_PASSWORD'] - Add import os to access environment variables - Ensures password consistency with build ARG/ENV pattern - Improves security and flexibility of Docker build process
|
Note Other AI code review bot(s) detectedCodeRabbit 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. WalkthroughAdds system packages to the Docker image, tightens Poetry install, and changes Django superuser creation to use an ARG/ENV and set the password post-creation. Also makes pyproject.toml package include explicit source ( Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Builder as Docker build
participant Apt as apt-get
participant Poetry as Poetry installer
participant Manage as Django manage.py
Builder->>Apt: install pkg-config, libmysqlclient-dev, build-essential
Builder->>Poetry: poetry install --no-root
note right of Poetry #D6EAF8: pyproject packages include from="."
Builder->>Manage: run createsuperuser (no password)
Builder->>Manage: run manage.py shell -> set admin password from ENV
note right of Manage #E8F8F5: Password set after test data load
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
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 |
Summary of ChangesHello @omsherikar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical Docker build failures by resolving issues related to MySQL client compilation and Poetry package management. It also improves the reliability of superuser creation within the Docker environment, ensuring that the admin user is correctly set up and its password is properly configured without being overwritten. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses several Docker build issues, including missing system dependencies, Poetry configuration problems, and the superuser creation process. The changes are logical and well-justified. My review includes a critical security recommendation to prevent leaking the superuser password into the Docker image and a suggestion for improving the Dockerfile structure to create a smaller, more secure final image.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
Dockerfile(3 hunks)pyproject.toml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.toml
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
TOML files must be valid (check-toml)
Files:
pyproject.toml
🔇 Additional comments (1)
pyproject.toml (1)
6-8: Poetry auto-discovery works hereCommenting out the
packagesoverride lets Poetry fall back to its default discovery, which avoids the/app/web does not contain any elementbuild error while still packaging the project correctly. Thanks for aligning this with the Docker fix.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
🚨 Missing Open Issue LinkThis pull request does not reference any open GitHub issue via the Development section. PRs must be linked to an open issue using GitHub’s "Development" section (on the right sidebar). How to fix this:
This PR will be automatically closed. You can reopen it after linking an open issue. Thank you! |
Resolves MySQL client build failures and Poetry package installation errors
Related issues
Fixes #706
Checklist
Summary by CodeRabbit