Skip to content

feat: complete the Docker setup — wire the compose stack, add a PHP 8.4 CLI image (IP-149)#611

Open
nielsdrost7 wants to merge 2 commits into
InvoicePlane:developfrom
underdogg-forks:feature/149-docker-cli-image
Open

feat: complete the Docker setup — wire the compose stack, add a PHP 8.4 CLI image (IP-149)#611
nielsdrost7 wants to merge 2 commits into
InvoicePlane:developfrom
underdogg-forks:feature/149-docker-cli-image

Conversation

@nielsdrost7

Copy link
Copy Markdown
Collaborator

Completes the standalone Docker setup from feature/149-docker-setup (issue #149) and adds the missing piece: a CLI image so users and contributors can run the test suite, artisan, and composer with no PHP on the host.

What this adds on top of the existing branch

  1. docker-resources/php-cli/Dockerfile — PHP 8.4 CLI (alpine), the exact extension twin of the existing php-fpm image (intl, gd, pdo_mysql, bcmath, zip, exif, soap, redis) plus Composer, a 1G memory limit (the full suite OOMs at the 128M default), and bundled pdo_sqlite — the test suite runs on in-memory sqlite, so tests need zero services. UID/GID build args let Linux users match host ownership for files written into the mounted repo (vendor/, storage/) — this exact mismatch produces hundreds of confusing tempnam() test errors otherwise.
  2. docker-compose.yml actually wires the images in. The branch shipped apache + php-fpm Dockerfiles but the compose file only started db + mailcatcher, and DOCKER.md referenced an app container that didn't exist. Now: web (apache, port ${APP_PORT:-8080}) → app (php-fpm, matching the vhost's fcgi://app:9000) → db, plus the new cli service behind a tools profile so it never auto-starts.
  3. .github/DOCKER.md rewritten to match reality — corrected clone URL (pointed at v1's repo), a services table, a no-host-PHP quick start, test-suite instructions, and the UID/GID troubleshooting entry.

Why a CLI image at all

The vendor tree requires PHP ≥ 8.3 with intl + gd; typical host PHPs miss at least one of those (Filament table rendering hard-requires intl, dompdf wants gd). This image is the supported, reproducible way to run vendor/bin/phpunit — validated by developing the Report Builder with a hand-rolled equivalent of exactly this image.

Verified

  • docker compose config valid; --profile tools exposes cli alongside the five services
  • CLI image builds clean; php -m shows the full extension set; composer --version works
  • Test suite executes through docker compose run --rm cli vendor/bin/phpunit (sqlite in-memory). Note: some company-panel tests fail on this branch's lineage because it predates the permission-seeding fixes on develop — pre-existing to this PR; the same command is fully green on branches that include those fixes.
  • Web stack (web + app) is config-validated against the existing vhost (fcgi://app:9000, docroot htdocs/public); it still needs a bootstrapped .env + key to serve, per DOCKER.md's quick start.

Closes #149

🤖 Generated with Claude Code

nielsdrost7 and others added 2 commits June 12, 2026 22:23
…lopment

Brings in custom Dockerfiles for PHP-FPM, Apache, and Node from the
original feature/docker-env branch, ported cleanly onto develop.

- docker-resources/php-fpm/Dockerfile  — PHP 8.4-fpm-alpine with all
  required extensions (pdo_mysql, gd, intl, redis, opcache, etc.)
- docker-resources/apache/Dockerfile   — Apache 2.4 with PHP-FPM proxy
- docker-resources/apache/config/invoiceplane-vhost.conf
- docker-resources/node/scripts/entrypoint.sh — Vite dev server with
  Docker-aware path and HMR configuration

Refs InvoicePlane#149

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The branch shipped apache and php-fpm Dockerfiles that docker-compose.yml
never started, and DOCKER.md described an app container that did not
exist. The compose file now runs web (apache, APP_PORT with 8080
default) -> app (php-fpm, matching the vhost's fcgi://app:9000) -> db,
plus mailcatcher.

Adds docker-resources/php-cli: a CLI twin of the php-fpm image (same
extension set: intl, gd, pdo_mysql, bcmath, zip, exif, soap, redis)
with Composer, a 1G memory limit for the test suite, and UID/GID build
args so files written into the mounted repo keep host ownership. It
runs behind a "tools" compose profile as a one-off runner:

    docker compose run --rm cli vendor/bin/phpunit

The test suite runs on in-memory sqlite, so tests need no services at
all. DOCKER.md rewritten to match (correct v2 clone URL, services
table, no-host-PHP quick start, ownership troubleshooting).

Refs InvoicePlane#149

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nielsdrost7, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd65e5c3-9733-4a76-afd3-f695f4ffa0aa

📥 Commits

Reviewing files that changed from the base of the PR and between d086ad1 and bd71fad.

📒 Files selected for processing (7)
  • .github/DOCKER.md
  • docker-compose.yml
  • docker-resources/apache/Dockerfile
  • docker-resources/apache/config/invoiceplane-vhost.conf
  • docker-resources/node/scripts/entrypoint.sh
  • docker-resources/php-cli/Dockerfile
  • docker-resources/php-fpm/Dockerfile
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

[Infrastructure]: Make Docker setup more complete

1 participant