-
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
php
bysail
, eg:sail artisan queue:work
.
- Create an IAM user with Policy:
- AmazonEC2ContainerRegistryFullAccess
- AmazonECS_FullAccess
-
Add
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
into 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.json
tocfn_parameters.json
. Update your own parameters incfn_parameters.json
then create stack fromcloudformation.yml
.NOTE: keep
ServiceTaskDesiredCount = 0
as 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 = 0
intoServiceTaskDesiredCount = 1
in filecfn_parameters.json
. -
Run this command to
update-stack
on CloudFormation.aws cloudformation update-stack \ --stack-name laravel-sail-ecs \ --template-body file://cloudformation.yml \ --parameters file://cfn_parameters.json \ --capabilities CAPABILITY_NAMED_IAM