trypost/compose.override.yaml.example
André Dantas d15981b8fd feat(docker): replace stale Sail compose with self-contained stack
The previous compose.yaml referenced ./vendor/laravel/sail/runtimes/8.5
which was never wired up (sail isn't installed and the runtime path
doesn't exist), so docker compose up failed out of the box. It also
lacked Reverb, queue workers, and the scheduler.

The new compose.yaml:

  - Builds the dev target of docker/Dockerfile so a single
    `docker compose up --build` brings up the entire stack with no host
    PHP or Node prerequisites.
  - Bind-mounts the project root for hot-reload, with named volumes for
    vendor/ and node_modules/ so image-baked deps survive the bind.
  - Pins Postgres to 16-alpine (matches CI) and Redis to 7-alpine.
  - Healthchecks gate `app` startup until pgsql and redis are ready.
  - Sets DB_HOST=pgsql, DB_USERNAME=postgres, REDIS_HOST=redis as
    process env so .env.testing's pre-existing CI defaults
    (DB_HOST=127.0.0.1, DB_USERNAME=root) don't break tests run from
    inside the container.

compose.override.yaml.example documents per-developer customizations
(UID/GID alignment on Linux, port conflicts, Xdebug, Selenium) without
forcing a specific workflow. .env.testing.local is added to .gitignore
as a safety net for any future per-developer testing override.
2026-05-12 23:44:55 -03:00

52 lines
1.5 KiB
Text

# TryPost — Compose override example.
#
# Compose automatically merges `compose.override.yaml` (gitignored, per-developer)
# on top of `compose.yaml`. Copy this file to start customizing:
#
# cp compose.override.yaml.example compose.override.yaml
#
# Common overrides are commented below. Uncomment what you need.
services:
app:
# Match container UID/GID to your host user (Linux contributors on
# systems where your UID isn't 1000).
# build:
# args:
# UID: 1001
# GID: 1001
# Enable Xdebug (requires installing the extension via a Dockerfile
# tweak; left commented as a hint).
# environment:
# XDEBUG_MODE: debug
# XDEBUG_CONFIG: 'client_host=host.docker.internal'
# Forward additional ports if 8000/5173/8080 conflict with another
# service on your host.
# ports:
# - '9000:80'
pgsql:
# Free up host port 5432 (e.g. when running another Postgres locally).
# ports:
# - '54320:5432'
redis:
# ports:
# - '63790:6379'
mailpit:
# Move the Mailpit UI off port 8025.
# ports:
# - '8025:8025'
# - '1025:1025'
# Add additional services here — e.g. a Selenium container for Dusk tests:
#
# selenium:
# image: selenium/standalone-chromium
# extra_hosts:
# - 'host.docker.internal:host-gateway'
# volumes:
# - '/dev/shm:/dev/shm'