Skip to content

Instantly share code, notes, and snippets.

@micoli
Created June 7, 2019 13:10
Show Gist options
  • Save micoli/3e623a7e63f41100a4d7c33cb7d31118 to your computer and use it in GitHub Desktop.
Save micoli/3e623a7e63f41100a4d7c33cb7d31118 to your computer and use it in GitHub Desktop.
Minimalist Makefile to help local php DX
default: help
help:
@echo "Usage:"
@echo " make [command]"
@echo
@echo "Available commands:"
@grep -v '^_' Makefile | grep '^[^#[:space:]].*:' | grep -v '^default' | sed 's/:\(.*\)//' | xargs -n 1 echo ' -'
@echo
stop-dev:
docker kill php-dev-runner || true
docker rm php-dev-runner || true
up-dev: stop-dev
docker run -d -t --name php-dev-runner -v $$PWD:$$PWD -p 0.0.0.0:8083:8083 -w $$PWD thecodingmachine/php:7.3-v2-cli -- php -S 0.0.0.0:8083 -t public/
shell:
docker exec -it php-dev-runner bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment