-
Update the Local port in
.env. -
Enable XDebug.
- Set
SAIL_XDEBUG=true - Run
sail build --no-cache - Check
sail php -v
-
Just need HTTP:
sail share(30 mins). -
HTTPS: use
ngrok http --region=ap 81(120 mins and ngrok makes life much easier).
-
Open
.zshrc, addalias sail="./vendor/bin/sail". -
Replace
phpbysail, eg:sail artisan queue:work.
- Create an IAM user with Policy:
- AmazonEC2ContainerRegistryFullAccess
- AmazonECS_FullAccess
-
Add
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYinto Github repository > Settings > Secrets. -
Create a bucket via AWS console and upload your production .env file.
NOTE: file name must be
your-app-name.env, eg:laravel-sail-ecs.env. -
Copy
cfn_parameters.example.jsontocfn_parameters.json. Update your own parameters incfn_parameters.jsonthen create stack fromcloudformation.yml.NOTE: keep
ServiceTaskDesiredCount = 0as initial.aws cloudformation create-stack \ --stack-name laravel-sail-ecs \ --template-body file://cloudformation.yml \ --parameters file://cfn_parameters.json \ --capabilities CAPABILITY_NAMED_IAM -
Push your code to branch
main. -
Change
ServiceTaskDesiredCount = 0intoServiceTaskDesiredCount = 1in filecfn_parameters.json. -
Run this command to
update-stackon CloudFormation.aws cloudformation update-stack \ --stack-name laravel-sail-ecs \ --template-body file://cloudformation.yml \ --parameters file://cfn_parameters.json \ --capabilities CAPABILITY_NAMED_IAM