Main Goals
- Dockerize existing and new php (Laravel) based Web apps
- Code base and version control (GitHub)
- Use Docker for local development and in production
- Automate deployments: CI/CD Pipeline to build, test and deploy in the Cloud (GitHub Actions, AWS CodeBuild)
- Evaluate RollingDeployment Strategy vs Blue-Green Deployment
- Use Cloud native technologies and tools (AWS)
- S3 Service (storage, env config)
- Elastic Container Registry - ECR (private repositories)
- Elastic Container Service - ECS (container orchestration)
- Load Balancing
- MySql/MariaDB (RDS)
- Redis cluster, caching, session management, queueing (MemoryDB Cluster)
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- Laravel Framework.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, powerful, and provides tools required for large, robust applications.
- Create project
- Local Development: use Laravel Sail
Create Project using the ./ctl script. Then:
docker exec -it aws-ecs-laravel-demo-app-1 sh -c "cd /var/www/html && composer create-project laravel/laravel"
Local Dev: Login to docker instance an run commands directly
- docker exec -it <container-name> bash OR
- use the ./ctl script: ./ctl <command> OR
- use Laravel Sail: sail <command>
We will be using Sail!
Installing Laravel Breeze with Blade
sail composer require laravel/breeze --dev
sail php artisan breeze:install blade
# (optional): if you want to use Redis with the predis driver
# sail composer require predis/predis
Warning
Important note about Redis
If you configure AWS Cluster, only "predis" will work locally with Laravel-Cluster config. "phpredis" will NOT work with Laravel-Cluster config against local Redis Server, which ist not a cluster! Check out the sources at 'config/database.php'.
Verify & Run
sail config
sail up -d
sail art migrate
sail npm install && sail npm run dev
# open http://localhost:8080
For creating Test-DB (dbname=testing, dbuser=homestead):
sail exec mysql mysql -u root -p -e "create database testing charset utf8mb4;"
sail exec mysql mysql -u root -p -e "grant all privileges on testing.* to homestead@'%';"