Update Python dependencies and Docker base image #4

Merged
overspend1 merged 1 commits from claude/update-python-dependencies-01Tb7V7mEiTXHTqiM81Zgh54 into main 2025-11-21 12:59:47 +01:00
overspend1 commented 2025-11-21 12:59:37 +01:00 (Migrated from github.com)

Backend fixes:

  • Add g++ and build-essential for complete C++ compilation support
  • Upgrade pip, setuptools, and wheel before installing dependencies
  • Ensures psutil and other packages with native extensions build correctly

Frontend fixes:

  • Add build arguments for NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL
  • Pass environment variables during Docker build stage
  • Set default values to prevent undefined destination in Next.js rewrites
  • Configure docker-compose to pass build arguments to frontend service

These changes resolve:

  • psutil build failure: "ERROR: Failed building wheel for psutil"
  • Next.js build error: "Invalid rewrite found" with undefined destination

Summary by CodeRabbit

  • Chores
    • Enhanced Docker build configuration with upgraded Python packaging tools and optimized build dependencies for backend services.
    • Made API and WebSocket URLs fully configurable at both build and runtime stages, enabling seamless deployments across different environments without requiring container rebuilds.

✏️ Tip: You can customize this high-level summary in your review settings.

Backend fixes: - Add g++ and build-essential for complete C++ compilation support - Upgrade pip, setuptools, and wheel before installing dependencies - Ensures psutil and other packages with native extensions build correctly Frontend fixes: - Add build arguments for NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL - Pass environment variables during Docker build stage - Set default values to prevent undefined destination in Next.js rewrites - Configure docker-compose to pass build arguments to frontend service These changes resolve: - psutil build failure: "ERROR: Failed building wheel for psutil" - Next.js build error: "Invalid rewrite found" with undefined destination <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced Docker build configuration with upgraded Python packaging tools and optimized build dependencies for backend services. * Made API and WebSocket URLs fully configurable at both build and runtime stages, enabling seamless deployments across different environments without requiring container rebuilds. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
coderabbitai[bot] commented 2025-11-21 12:59:45 +01:00 (Migrated from github.com)

Caution

Review failed

The pull request is closed.

Walkthrough

Docker configuration updates to add build-time arguments for frontend API connectivity and enhance backend build dependencies. Changes include introducing configurable environment variables for the Next.js build, adding Python packaging tools, and switching to user-level package installation for the backend.

Changes

Cohort / File(s) Summary
Backend image dependencies
backend/Dockerfile
Added g++ and build-essential to apt-get dependencies; upgraded pip, setuptools, and wheel; switched to user-level pip install for requirements
Frontend image configuration
frontend/Dockerfile
Introduced build-time arguments NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL with defaults; applied as environment variables to both build and runtime stages
Compose build arguments
docker-compose.yml
Added build arguments NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL to frontend service for passing during image build

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Verify default values for NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL are appropriate
  • Confirm user-level pip install in backend doesn't introduce permission issues in production
  • Check that g++ and build-essential additions are necessary for the backend build

Poem

🐰 Docker layers nested tight,
With args that flow from build to flight,
Backend thrives on tools so grand,
Frontend knows the API land,
Config now with purpose bright! 🐳

Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/update-python-dependencies-01Tb7V7mEiTXHTqiM81Zgh54

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2c4601b9d8 and 22fce19050.

📒 Files selected for processing (3)
  • backend/Dockerfile (1 hunks)
  • docker-compose.yml (1 hunks)
  • frontend/Dockerfile (2 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- This is an auto-generated comment: failure by coderabbit.ai --> > [!CAUTION] > ## Review failed > > The pull request is closed. <!-- end of auto-generated comment: failure by coderabbit.ai --> <!-- walkthrough_start --> ## Walkthrough Docker configuration updates to add build-time arguments for frontend API connectivity and enhance backend build dependencies. Changes include introducing configurable environment variables for the Next.js build, adding Python packaging tools, and switching to user-level package installation for the backend. ## Changes | Cohort / File(s) | Summary | |---|---| | **Backend image dependencies** <br> `backend/Dockerfile` | Added g++ and build-essential to apt-get dependencies; upgraded pip, setuptools, and wheel; switched to user-level pip install for requirements | | **Frontend image configuration** <br> `frontend/Dockerfile` | Introduced build-time arguments NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL with defaults; applied as environment variables to both build and runtime stages | | **Compose build arguments** <br> `docker-compose.yml` | Added build arguments NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL to frontend service for passing during image build | ## Estimated code review effort 🎯 1 (Trivial) | ⏱️ ~5 minutes - Verify default values for NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL are appropriate - Confirm user-level pip install in backend doesn't introduce permission issues in production - Check that g++ and build-essential additions are necessary for the backend build ## Poem > 🐰 Docker layers nested tight, > With args that flow from build to flight, > Backend thrives on tools so grand, > Frontend knows the API land, > Config now with purpose bright! 🐳 <!-- walkthrough_end --> <!-- finishing_touch_checkbox_start --> <details> <summary>✨ Finishing touches</summary> <details> <summary>🧪 Generate unit tests (beta)</summary> - [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests - [ ] <!-- {"checkboxId": "07f1e7d6-8a8e-4e23-9900-8731c2c87f58", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Post copyable unit tests in a comment - [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit unit tests in branch `claude/update-python-dependencies-01Tb7V7mEiTXHTqiM81Zgh54` </details> </details> <!-- finishing_touch_checkbox_end --> --- <details> <summary>📜 Recent review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2c4601b9d817050b7188211779e6c8da2718a3cb and 22fce19050e18f5619a7f44a49f85753c4a17d93. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `backend/Dockerfile` (1 hunks) * `docker-compose.yml` (1 hunks) * `frontend/Dockerfile` (2 hunks) </details> </details> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=overspend1/bot-dashboard&utm_content=4)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub> <!-- tips_end --> <!--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