KintoHub
A sample Laravel app forThis 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 locally
Requires 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 project
Click on the Use this Template button at the top right
Begin to modify the files as you please!
🚀 Deploying on KintoHub
If 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/kintohub-examples/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:
APP_NAME=Laravel
APP_ENV=dev
APP_KEY=base64:PoStwuoIPBnH+W2znwpmQbZvCJZPdou1DedUu+3F7mI=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
This will take about 6 minutes to complete
Deploy Nginx Php Proxy
We 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/kintohub-examples/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!
🚑 Support
Contact us: https://www.kintohub.com/contact-us
Discord: https://kintohub.com/discord