Commit graph

4 commits

Author SHA1 Message Date
André Dantas
ef501dd385 fix(docker): add Reverb WebSocket proxy to nginx
Add /app/ (Pusher protocol) and /apps/ (REST API) location blocks
with Upgrade/Connection headers so browsers can connect to the
in-container Reverb server via the same port 80/443 endpoint.
2026-05-12 23:44:55 -03:00
André Dantas
1a74dfc60e fix(docker): production build/runtime fixes from homelab deploy
- Add libwebp-dev + libavif-dev and --with-webp --with-avif to GD
  configure (fixes imagewebp() undefined at runtime)
- Merge wayfinder-gen into asset-build stage: PHP + Node together
  so @laravel/vite-plugin-wayfinder can invoke artisan during build
- Pass VITE_* as build args and ENV so they bake into the bundle
- Stub APP_URL=http://localhost so artisan boot doesn't crash on null
- mkdir -p storage/framework/{cache/data,sessions,views} storage/logs
  bootstrap/cache before artisan runs (dirs stripped by .dockerignore)
- Production stage: rm vendor + bootstrap/cache/*.php before swapping
  to prod-only deps (prevents missing-provider errors from dev cache)
- Switch production chown from app:app to www-data:www-data to match
  Alpine php-fpm default pool user
2026-05-12 23:44:55 -03:00
André Dantas
7d3b8a478e fix(docker): drop stripe envs and bump upload limits to 1G
Two adjustments from the PR review.

Stripe placeholders (STRIPE_KEY, STRIPE_SECRET, STRIPE_WEBHOOK_SECRET,
and the eight price IDs) only matter when SELF_HOSTED=false. The
Docker stack defaults to SELF_HOSTED=true, so keeping the block in
.env.docker.example just adds noise for first-time contributors.

upload_max_filesize and post_max_size go from 100M to 1G in both
php.dev.ini and php.prod.ini to accept full-length video uploads.
Bumping nginx client_max_body_size to match — otherwise the proxy
would cut the request off before PHP ever sees it.
2026-05-12 23:44:55 -03:00
André Dantas
4ce5c9173f feat(docker): add multi-stage Dockerfile with dev and production targets
Introduces a self-contained Docker build under docker/ that boots the
full Laravel + Vite + Reverb + Horizon + scheduler stack inside a
single container.

The Dockerfile exposes two targets sharing a common system-base layer
(PHP 8.4-FPM Alpine + Postgres/Redis/intl/sockets/redis extensions):

  - dev: bind-mount source at runtime, runs Vite via supervisord, hot
    reloads PHP via opcache.validate_timestamps=1, UID/GID build args
    align container writes with the host user.

  - production: ships the prebuilt application — composer --no-dev,
    npm run build + build:ssr, wayfinder TS pre-generated, OpCache
    hardened, fixed UID 1000.

Sidecar configs (nginx, php.{dev,prod}.ini, supervisord.{dev,prod}.conf,
entrypoint, postgres-init for the test DB) live next to the Dockerfile
so the build context is self-describing. The entrypoint is idempotent
and handles APP_KEY generation, migrations, storage:link, Passport
keys, Wayfinder regen, and dependency reinstall on every boot.
2026-05-12 23:44:55 -03:00