This document describes the Makefile provided for the Satifly project. It explains variables, available targets, examples, and Xdebug toggles.
The file aims to simplify common Docker, Composer, and Symfony workflows.
Common quick commands:
make help— show available commandsmake start— build images, start containers, install dependenciesmake stop— stop and remove containersmake shell— open a bash shell inside the PHP container
These variables are defined in the Makefile and can be overridden on the command line or in your environment.
APP_NAME— application name (default:satifly)APP_PORT— HTTP port forwarded from the container (default:8000)COMPOSE— docker compose command (default:docker compose)PHP_CONTAINER— name of the PHP service/container in docker-compose (default:php)ENV_FILE— path to environment file checked bymake env-check(default:.env)
Example: run make with a different port:
APP_PORT=8080 make start
The Makefile exposes the following main targets. Use make help inside the repo to get a live list.
build— Build Docker images (pull latest, no cache).up— Start containers and wait until ready.down— Stop and remove containers, networks and orphaned services.restart— Equivalent tomake downthenmake up.logs— Tail service logs (docker compose logs -f).ps— Show running containers (docker compose ps).clean— Remove containers, images and volumes:docker compose down --rmi all --volumes --remove-orphans.rebuild— Full teardown + build + up (runsclean,build, thenup).
install— Runcomposer install -n --prefer-distinside the PHP container.update— Runcomposer updateinside the PHP container.shell— Open an interactive bash shell in the PHP container:docker compose exec <php> bash.test— Run PHPUnit tests:php bin/phpunitinside container.satis-init— Run the interactivevendor/bin/satis initcommand.satis-build— Runvendor/bin/satis buildto generate package definitions.
permissions— Fix file ownership/permissions forvarandpublicfolders.env-check— Ensure an.envfile exists; copies from.env.distif missing.doctor— Run a Symfony environment/info check (example:php bin/console about).
Convenience targets to enable/disable Xdebug inside the PHP container at runtime. These targets assume the container uses a standard PHP configuration directory (/usr/local/etc/php/conf.d).
-
xdebug-on— Create a small config file enabling Xdebug and restart the PHP container. It writes:zend_extension=xdebug xdebug.mode=debug xdebug.start_with_request=yesThen restarts the PHP container to apply changes.
-
xdebug-off— Remove the Xdebug config file and restart the PHP container.
# Build, start and install deps make start
Open the app
https://localhost:8000
(or the port set with APP_PORT)
# Turn Xdebug on make xdebug-on
Attach your debugger (IDE) to the forwarded port / container
When finished, turn it off:
make xdebug-off
# Full clean + rebuild make rebuild
- Composer hanging or failing: ensure
auth.jsonis present if you access private repos. Usemake shelland run composer manually inside the container to inspect errors. - Missing .env: run
make env-checkor copy.env.distto.env. - Xdebug not connecting: check
xdebug.client_host(you may need to set it tohost.docker.internalor your host IP). See the Notes on Xdebug host configuration below.
The Makefile toggles Xdebug on/off but does not set xdebug.client_host. For reliable IDE connections on macOS/Windows use host.docker.internal. On Linux you may need to set the host IP manually. To add automatic detection, you can modify the xdebug-on target to append a line like:
echo "xdebug.client_host=$(HOST_IP)" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
Where HOST_IP can be computed dynamically (e.g. via ip route get 1 or supplied as an environment variable).
- You can add more targets to run common
bin/consolecommands (migrations, cache:clear, doctrine commands, etc.). - If your PHP container has a different name in
docker-compose.yml, setPHP_CONTAINERwhen invoking make, e.g.PHP_CONTAINER=app_php make shell. - To add environment-specific behavior (CI vs local), you can create
Makefile.ciand include it or add conditionals that readAPP_ENV.