12 factor php service skeleton
brew install docker
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' apt-get update apt-get install docker-engine
make to build
make dev to build and run local version
Dev version will appear here: http://localhost:8081
- php7.1 + php-fpm
- slim ^3.0
- supervisord to rule them all
12 factor Manifest
composer create-project fridaylabs/service -s dev --no-install --ignore-platform-reqs <SERVICE_NAME>
and push it to your repo
Solved by composer
- All configs should be pulled from environment.
- Don't use variables like APPLICATION_ENVIRONMENT!
.envfile for local setup
Use config for connecting with DB, Queue or other services
Build, release, run
make devto build and run local version
- TODO: Push your branch to run tests, merge branch to release
- Make sure, that your app is stateless.
- Store all your data into remote services
- App exposing 80 and 443 port.
- Default dev port is 8081
Solved by php-fpm
Solved by supervisord
Solved by docker and composer
- Nginx, php-fpm and app writes logs to stdout
- Don't write logs to FS