fridaylabs / service
12 factor service skeleton
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.1
- illuminate/support: ^5.4
- monolog/monolog: ^1.23
- slim/php-view: ^2.2
- slim/slim: ^3.0
- vlucas/phpdotenv: ^2.4
Requires (Dev)
- phpunit/phpunit: ^6.2
This package is not auto-updated.
Last update: 2024-10-27 04:54:00 UTC
README
TL;DR
install
macOs: brew install docker
Linux/Unix:
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
use
make
to build
make dev
to build and run local version
Dev version will appear here: http://localhost:8081
What's inside
- nginx
- php7.1 + php-fpm
- slim ^3.0
- supervisord to rule them all
12 factor Manifest
Codebase
Create project
composer create-project fridaylabs/service -s dev --no-install --ignore-platform-reqs <SERVICE_NAME>
and push it to your repo
Dependencies
Solved by composer
Config
- All configs should be pulled from environment.
- Don't use variables like APPLICATION_ENVIRONMENT!
- Use
.env
file for local setup
Backing services
Use config for connecting with DB, Queue or other services
Build, release, run
- Type
make
to build - Type
make dev
to build and run local version - TODO: Push your branch to run tests, merge branch to release
Processes
- Make sure, that your app is stateless.
- Store all your data into remote services
Port binding
- App exposing 80 and 443 port.
- Default dev port is 8081
Concurrency
Solved by php-fpm
Disposability
Solved by supervisord
Dev/prod parity
Solved by docker and composer
Logs
- Nginx, php-fpm and app writes logs to stdout
- Don't write logs to FS
Admin processes
TODO