Skip to content

Instantly share code, notes, and snippets.

@immutef
Last active December 24, 2015 03:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save immutef/6736993 to your computer and use it in GitHub Desktop.
Save immutef/6736993 to your computer and use it in GitHub Desktop.
Symfony & Foreman
SYMFONY__DATABASE_DRIVER="pdo_mysql"
SYMFONY__DATABASE_HOST="127.0.0.1"
SYMFONY__DATABASE_PORT=3306
SYMFONY__DATABASE_NAME="symfony"
SYMFONY__DATABASE_USER="root"
SYMFONY__DATABASE_PASSWORD=""
concurrency: web=1
env: .env
procfile: Procfile
PORT?=5000
FOREMAN=foreman run
SYMFONY=$(FOREMAN) php app/console
.PHONY: server
server:
foreman start -p $(PORT)
symfony:
$(SYMFONY) $(filter-out $@,$(MAKECMDGOALS))
%:
@exit
web: php app/console server:run 127.0.0.1:$PORT
@immutef
Copy link
Author

immutef commented Sep 28, 2013

Usage

$> make server
foreman start -p 5000
02:13:05 web.1  | started with pid 1678
02:13:06 web.1  | Server running on 127.0.0.1:5000

$> make symfony
foreman run php app/console 
Symfony version 2.3.5 - app/dev/debug
...

Benefits

  • Compatible with the Twelve-Factor App manifesto
  • No virtual boxing, no provisioning, just Homebrew
  • app/config/parameters.yml could be left out
  • Foreman could also manage additional services
  • One simple make instruction to rule them all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment