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 laravel service
envfile: .env.tpl
project_id:"1690972020931"
project_name: laravel-auth-mysql
services:
laravelservice:
path: services/laravel
ingress:null
# This is how services/laravel/bolt.service.yaml looks
Also we have added depends_on key in bolt.service.yaml so that sql service will go up first.
Adding MySQL service as a Bolt Service
To add MySQL service, run the following command -
$ bolt service:add sql services/mysql
Creating app inservice
Scanning source code
Detected MySQL app
Installed mysql 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 sql service
envfile: .env.tpl
project_id:"1690972020931"
project_name: laravel-auth-mysql
services:
laravelservice:
path: services/laravel
sql:
path: services/mysql
ingress:null
vm:
name: laravelauthmysql
# This is how services/mysql/bolt.service.yaml looks
# Note that volumes are not configured, we have added it manually to the service
container_name: sql
stateless:true
default_service_runner: docker
service_discovery_offset:
-3306
supported_service_runners:
- docker
service_runners:
docker:
envfile: .env
build: ./run.Dockerfile
volumes:
- ./services/mysql/data:/var/lib/mysql
ports:
- ${ASSIGNED_PORT}:3306
Running the Project
Now, let's run the project using Bolt.
# The following command will run the service as per the configuration in bolt.yaml file