This tutorial is about how to run a Laravel app using bolt. Below's the video showing how to run this tutorial.
Table of Contents
Objectives
Project Structure
Initialising the project using Bolt
Adding service as a Bolt Service
Running the Project
Running the Project on Docker
Running the Project on Local
Listing Bolt Services
Monitoring Service Logs
Stopping Your Project
Repo Link
Objectives
Here we have created a project where we have one service called myapp which is a laravel app.
Our Main objectives are:
Run this project using bolt in local machine.
Run this project using bolt in docker.
Project Structure
The project structure of our app is as follows:
# Below's the directory structure of our project.
laravel-app/
╰─➤ service/
╰─➤ ...laravel files
╰─➤ bolt.service.yaml
╰─➤ build.Dockerfile
╰─➤ .env.tpl
╰─➤ run.Dockerfile
╰─➤ .env
╰─➤ .env.tpl
╰─➤ bolt.yaml
╰─➤ .gitignore
╰─➤ Readme.md
Initialising the project using Bolt
At first we have initialised the project by running bolt init command to create bolt.yaml file.
$ cd laravel-app
$ bolt init --name laravel-app
It has created a bolt.yaml file in our project's root directory.
envfile: .env.tpl
project_id:"1690964916850"
project_name: laravel-app
services:null
ingress:null
Adding service as a Bolt Service
Now, in order to add service as a service in bolt we have executed the following command:
$ bolt service:add laravelservice service/
Creating app inservice
Scanning source code
Detected Laravel app
Installed myapp serviceinservice
Verifying metadata for other services..
Metadata verified
Bolt service:add command runs and automatically detects the type of service you are using and creates a bolt.service.yaml template init & includes the same into your bolt.yaml file.
# This is how bolt.yaml file looks after adding service as a service