Skip to content

Conversation

@loks0n
Copy link
Member

@loks0n loks0n commented Nov 30, 2025

reduces image size significantly

Summary by CodeRabbit

  • Chores
    • Optimized Docker build configuration to reduce runtime dependencies while maintaining PostgreSQL client connectivity. Build-time artifacts are now properly separated from runtime requirements, resulting in a leaner final image.

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

@loks0n loks0n requested a review from abnegate November 30, 2025 18:21
@coderabbitai
Copy link

coderabbitai bot commented Nov 30, 2025

Walkthrough

The Dockerfile has been modified to reorganize PostgreSQL-related dependencies across build and runtime stages. The postgresql-dev package is removed from the final stage's runtime dependencies and replaced with libpq. Concurrently, postgresql-dev is added to the virtual build dependencies in the initial install block. This change separates PostgreSQL development tools into the build stage while maintaining the PostgreSQL client library in the runtime environment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that libpq provides all necessary runtime dependencies for PostgreSQL extensions
  • Confirm that postgresql-dev in the build stage captures all required build-time artifacts
  • Review the implications of this split for any PostgreSQL-dependent extensions compiled during the build

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: postgressql-dev ordering' accurately describes the main change—adjusting postgresql-dev package placement between build and runtime dependencies in the Dockerfile.
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
  • Commit unit tests in branch fix-postgressql-dev-ordering

📜 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 5e3f3b2 and 4039953.

📒 Files selected for processing (1)
  • Dockerfile (2 hunks)
⏰ 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: build
🔇 Additional comments (1)
Dockerfile (1)

174-211: The PostgreSQL dependency reorganization is correct and follows Docker best practices.

Moving postgresql-dev to the .deps virtual package (build-time) while adding libpq for runtime is the appropriate pattern. The pdo_pgsql extension requires only libpq at runtime—not postgresql-dev headers. The execution order is correct: postgresql-dev is available during the docker-php-ext-install pdo_pgsql compilation step (line 209) and safely removed via apk del .deps (line 210), reducing the final image size without affecting runtime functionality.


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.

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.

2 participants