This Laravel Lumen starter template is intended to be used for new projects.
- What's Included
- Requirements
- Using This Repository
- Testing
- Continuous Integration/Deployment Workflow Diagram - Diagram - Video
- FAQ
### What's IncludedFor details on how to contribute to this repo, please check out the contributing guide.
- Latest version of Lumen.
- Pre-configured
docker-compose.yml
that uses nginx, php-fpm and PostgreSQL. (How can I use MySQL?) - Travis-CI integration:
- Checks psr-2 compliance with phpcs.
- Runs phpunit tests within docker containers.
- Pushes deploy-ready containers for
staging
andmaster
branches to DockerHub.
- Dredd support for ensuring accurate API documentation.
- Environment reset script to allow a dev to easily reset a seeded environment
- Example configuration for deploying to Rancher.
We recommend watching this repository so you can apply updates made to this project to yours.
Realpage teams should contact [email protected] using this email template to get everything setup.
For everyone else:
- Clone this repo and delete the
.git
directory - Run
git init
and change the origin of the repo to point to your remote repository - Reference the contributing guide for running this application locally
- After running locally
docker exec -it $(docker ps -f name=fpm -q) php artisan clean:template
to strip out example migrations, seeds, tests, etc...
Create a repository that mirrors your GitHub namespace/repository except does not include dashes (DockerHub doesn't allow dashes). The travis configuration is already designed to handle this transition for you. An example of this would be:
GitHub: my-namespace/my-new-project
DockerHub: mynamespace/mynewproject
Configure the following environment variables:
DOCKER_EMAIL
DOCKER_USERNAME
DOCKER_PASSWORD
This user needs to have permission to write to the DockerHub repository so that it can push images.
### Testing- Dredd support for ensuring accurate API documentation. Can also be considered as acceptance tests
- PHPUnit for unit/functional testing
For more on testing, please see: Testing in the Lumen Starter on YouTube.
### FAQ ##### **How can I use MySQL?** * Set the `DB_CONNECTION` environment variable to `mysql` * Update the fpm/cli docker containers to `apt-get install php7.0-mysql`- the
default.conf
file located in theinfrastructure/nginx
directory will be added to the nginx container as part of the build - update the file and rebuild the container via
docker-compose build
to propagate the changes
Yes! Using an alias below, you can run commands in containers with dockerexc fpm php -v
instead of docker exec -it $(docker ps -f name=fpm -q) php -v
.
alias dockerexc='function _docker_exec(){ service=$1; shift; docker exec -it $(docker-compose ps -q ${service}) "$@" };_docker_exec'