Laravel Example
This example has been referenced and rebuilt from Aschmelyun/docker-compose-laravel. You can use this repository to deploy a Laravel app on KintoHub. Additionally, this guide can be used to quickly set up Laravel locally on your machine.
#
Directory Structure/laravel
- Generic installation of Laravel/nginx
- Configuration files for nginx to serve PHPlaravel.dockerfile
- Dockerfile to bootstrap Laravel appnginx.dockerfile
- Dockerfile to serve nginx websitedocker-compose.yaml
- Composition of nginx + laravel + postgres to work together
#
Running locallyRequires Docker v2.x or higher
In the root of this repository use docker-compose up -d
Once complete, go to localhost:8080
to access the website!
#
Setup a new projectClick on the Use this Template button at the top right
Begin to modify the files as you please!
#
๐ Deploying on KintoHubIf you do not have an account, first signup
#
Deploy a Postgres Server- Click on the Create Service button at the top right of your environment
- Click on the From Catalog tab and then select PostgreSQL Service
- Fill or generate your
username
,password
androot password
for your database - Click on the Deploy button at the top right.
Once complete, go to the Access tab and copy the Root User Connection String
This will take several minutes to complete
#
Deploy Laravel PHP App- Click on the Create Service button at the top right of your environment
- Choose Backend API service from the list
- Click on the Import URL tab
- Enter the repository URL as
https://github.com/kintoproj/kinto-examples
- Enter the path to the subfolder: ./laravel
- Click on the Connect button
- Change the Service Name/Hostname to
laravel
- Select the language as Dockerfile
- Change the Dockerfile Name to
laravel.dockerfile
- Change the Port to
9000
- Open the Environment Variables tab and enter the key
DATABASE_URL
and paste the connection string value you copied in the Deploy a Postgres Server Step - Additionally, paste the following into the key textbox:
This will take about 6 minutes to complete
#
Deploy Nginx Php ProxyWe need to deploy a web host proxy to serve the php app on KintoHub.
- Click on the Create Service button at the top right of your environment
- Choose Web App service from the list
- Click on the Import URL tab
- Enter the repository URL as
https://github.com/kintoproj/kinto-examples
- Enter the path to the subfolder: ./laravel
- Click on the Connect button
- Change the Service Name/Hostname to
nginx
- Select the language as Dockerfile
- Change the Dockerfile Name to
nginx.dockerfile
- Change the Port to
80
- Click on the Deploy button at the top right
When complete, open the Access tab and open the external URL to see your Laravel app!
#
๐ SupportSlack: https://join.slack.com/t/kintogoons/shared_invite/zt-mu6bvg79-BmkkdMRRwohJioZggXVYeA