- php-fpm docker base image: php:7.4-fpm
- Laravel version: 8.40
- Mysql: 5.7
- composer: latest version
- docker-compose: version 1.29.2
sudo amazon-linux-extras install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chkconfig docker on
sudo yum install -y git
sudo curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
docker-compose version
make build_base
make build_php
# Run all component
make up
# Don't care about base and nodejs service. It can be stopped when you check status of all containers
make show_all
# Visit http://localhost:20001
# Visit healthcheck to check the access log - http://0.0.0.0:20001/healthcheck
# Visit phpmysqladmin - http://0.0.0.0:20002 (host: mysql, username: root, password: 123456)
make down
make log_php
make log_nginx
make access_php
composer install
php artisan migrate
make access_php
php artisan cache:table
php artisan session:table
php artisan migrate
docker-compose -p laraveldemo -f docker-compose.yml up node
rm -rf src && mkdir src
DOCKER_IMAGE=laraveldemo_base
docker run -i --rm \
--entrypoint '/bin/bash' \
-v ${PWD}/src:/app ${DOCKER_IMAGE} \
-c 'composer create-project laravel/laravel /app'
- Add remove healthcheck nginx log
- Remove healthcheck applicaton log
Replace ACCOUNT_ID with your real value.
Replace PROJECT_NAME with your real value.
Pleace SHORT_ENV with the your real value.
Please AWS_REGION with your real value.
https://github.com/tfutils/tfenv
sudo yum install -y git
git clone --depth=1 https://github.com/tfutils/tfenv.git ~/.tfenv
echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
tfenv install latest
tfenv use x.y.z
terraform --version
cd iac/terraform/environments/dev/common
# To replace YOUR_S3_BUCKET with your S3 bucket in the provider.tf file.
# To replace YOUR_PROFILE with your aws profile name in the provider.tf and variables.tf file.
terraform init
terraform plan
terraform apply
- To use the file example/buildspect_example.yml to build the file codebuild/buildspect.yml.
- To use the file example/taskdef_template_example.json to build the file codeploy/taskdef_template.json.
- To use the file example/terraform_provider_example.tf to build the file iac/terraform/environments/dev/common/provider.tf
- Please update your ami_id for you region in iac/terraform/environments/dev/common/variables.tf . Firt running
make list_ami_aws_default
to get list aws aim and choose a item"
- Please update your ami_id for you region in iac/terraform/environments/dev/common/variables.tf . Firt running
- To use the file example/terraform_variables_example.tf to build the file iac/terraform/environments/dev/common/variables.tf
- To use the file example/ecs_example.tpl to build the file iac/terraform/environments/dev/common/scripts/ecs.tpl
Fill in variable in makefile with suitable values. If you are using aws ec2 instance profile, please leave AWS_PROFILE blank
make generate_settings