-
docker and docker-compose
Detailed instructions for setup of docker can be found here.
-
user added to
docker
group
We've written bash script that will do all things that you would normally have to do manually.
In order to run script all you have to do is run chmod +x init && chmod +x pre-commit && ./init
Script might ask you for your password at some point.
NOTE: To enter laravel container execute
docker exec -it laravel /bin/sh
-
Run docker containers in detached mode
docker-compose up -d
Whole stack can be stopped with
docker-compose stop
-
Check all service status:
docker-compose ps
-
Install project dependencies with composer in container
docker exec -it laravel composer install
-
Generate application key
docker exec -it laravel php artisan key:generate
-
Copy content from .env.example in .env (
cp .env.example .env
) -
Generate JWT secret key
docker exec -it laravel php artisan jwt:secret
sudo chmod -R 777 src/storage src/bootstrap/cache
- Edit /etc/hosts add local domain my-project.loc
127.0.0.1 my-project.loc
Feel free to replace
my-project.loc
with whatever works for you. In that case you should also changeAPP_URL
in .env
-
Visit http://localhost/api/documentation and feel free to try API using Swagger UI.
In case that you are using custom domain, swap
localhost
with your custom domain.App is available on through
http
port 80
We are using Health Panel to monitor key aspects of application and services.
- Web access for Health panel is available at
http://localhost/health/panel
- Health Panel can also return JSON status of each service at route
/health/check
- Heatlh panel can also be accessed with artisan commands
health:panel
andhealth:check
- To enable Slack notifications change
webhook_url
inservices
config - For more details about Health Panel go to their readme
If you want to use Google ReCaptcha, you can enabled it in recaptcha.php and add RECAPTCHA_SECRET_KEY in your .env file. Your configuration would look like this if you enable it:
<?php
return [
'enabled' => true,
'secret' => env('RECAPTCHA_SECRET_KEY')
];
Rule for ReCaptcha is already applied in UserLoginRequest and in UserCreateRequest.
To configure Sentry, go to the Sentry and create project for laravel and then just populate .env file with your project information:
SENTRY_LARAVEL_DSN=https://<key>@sentry.io/<project>
Laravel Telescope is included in this boilerplate.
- By default telescope is only available if
APP_ENV
islocal
. - Telescope is accessible at
/telescope
route. - Telescope can be disabled globally with ENV variable
TELESCOPE_ENABLED
. - In order to enable telescope in other environments you have to override
gate
method and removeisLocal
check fromregister
method inTelescopeServiceProvider
.
Install php formatter. More info.
- Install phpcs.
- Clone Vivify Ideas Coding Standards and make sure folder name is Vivify
- Open User Settings in VS Code and add
"phpcs.standard": "path_to_Vivify_folder_that_you_just_cloned"
There is separate docker-compose file (docker-compose.dist.yml
) for production/staging environments.
Biggest differences between dev and staging/production environments are that we are bundling all source files into images, instead of binding local source files to container.
In staging/production environment we included Portainer for easier container/swarm management with Web GUI.
We suggest using our docker registry (registry.vivifyideas.com
) for those environments, instead of building from Dockerfile
- Nginx at ports 80/443
- MariaDB at port 3306
- Portainer at port 9000