This compose.yaml file defines the local development environment for the
project. It includes essential services: Traefik (reverse proxy), PostgreSQL,
PHP, Nginx, and Adminer.
In most cases, you donβt need to modify your hosts file because
the .localhost domain automatically resolves to 127.0.0.1.
If you keep port 80 defined in compose.override.yaml, youβll need to specify
the port manually in the URL (e.g., http://api.esv.localhost:8080 for 8080
port).
| Service | Link | Profile |
|---|---|---|
| Nginx | http://api.esv.localhost | |
| Traefik Dashboard | http://traefik.esv.localhost | |
| Maildev | http://mail.esv.localhost | |
| Adminer | http://adminer.esv.localhost | debug |
We use a debug profile to optionally include development-only services.
You can enable profiles when running Compose using the --profile flag:
docker compose --profile debug up -dTo start all services regardless of their profile:
docker compose --profile="*" up -dAlternatively, you can use the provided Makefile command:
make start-allFor more information about Compose profiles, check the official documentation
- Image:
traefik:v3.4 - Handles routing to other services (Nginx, Adminer, ...).
- Exposes the Traefik dashboard at
http://traefik.esv.localhost. - Uses Docker as a dynamic configuration provider.
β οΈ The Traefik dashboard is exposed with--api.insecure=true. This should * only be used in development*.
- Image:
nginx:1.27.5-alpine - Loads configuration from a custom template* at
docker/nginx/templates/default.conf.template. - Routed through Traefik at
http://api.esv.localhost.
*See docker nginx documentation fastcgi_pass need to have a static string of
the php fpm host, so we use the environment variable.
- Image:
ghcr.io/esportsvideos/php:1.0.0-dev - Mounts the full project directory to
/var/wwwinside the container. XDEBUG_MODEis disabled by default.- Adds a host entry for
host.docker.internalto allow communication with the host machine (useful for debugging tools).
We maintain a dedicated PHP image in a separate repository because the specific parts of the build are always the same. This allows us to cache them and significantly reduce build times.
- Image:
maildev/maildev:latest - Routed through Traefik at
http://mail.esv.localhost. - Also exposes an SMTP server on port 1025 to capture outgoing emails.
We use Maildev to test and inspect emails sent during development, without actually sending them. It simplifies debugging email content and delivery logic.
- Image:
adminer:4.17.1 - Only started when the
debugprofile is enabled with `make start-all`` - We use the version 4.17.1 because newer versions have an issue with the design env var
- Routed through Traefik at
http://adminer.esv.localhost.