Deployment (AWS)
Overview
The production environment runs on AWS using ECS (Elastic Container Service) with Fargate for container orchestration. The application is packaged as a Docker image and deployed via CI/CD pipeline.
Architecture
Route53 → CloudFront → ALB → ECS Fargate (app + queue)
│
├── RDS PostgreSQL
└── ElastiCache Redis| Service | Purpose |
|---|---|
| Route53 | DNS management |
| CloudFront | CDN + SSL termination |
| ALB | Load balancing across ECS tasks |
| ECS Fargate | Container orchestration (serverless) |
| RDS PostgreSQL | Managed database |
| ElastiCache Redis | Cache + queue |
| S3 | File storage (backup, logs) |
| CloudWatch | Monitoring + logging |
CI/CD Pipeline
The pipeline is configured via GitHub Actions (.github/workflows/):
- Push to
develop/main→ triggers build - Build →
make build prod(production Dockerfile) - Test →
composer run ci:check(lint + format + types + test) - Push → Image pushed to ECR (Elastic Container Registry)
- Deploy → ECS service updated with new image
Required Secrets
| Secret | Description |
|---|---|
AWS_ACCESS_KEY_ID | IAM access key |
AWS_SECRET_ACCESS_KEY | IAM secret key |
AWS_ECR_REPOSITORY | ECR repository URI |
ECS_CLUSTER | ECS cluster name |
ECS_SERVICE | ECS service name |
APP_KEY | Laravel APP_KEY |
DB_* | Database credentials |
REDIS_* | Redis credentials |
Environment Variables
env
APP_ENV=production
APP_DEBUG=false
APP_KEY=base64:...
DB_CONNECTION=pgsql
DB_HOST=clustername.cluster-xxx.rds.amazonaws.com
DB_PORT=5432
DB_DATABASE=sutomo
DB_USERNAME=sutomo
DB_PASSWORD=...
REDIS_HOST=clustername.xxx.ng.0001.use1.cache.amazonaws.com
REDIS_PASSWORD=...
REDIS_PORT=6379
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=sutomo-productionMonitoring
| Tool | Purpose | Access |
|---|---|---|
| CloudWatch | Logs + metrics | AWS Console |
| Grafana | Dashboard | grafana.sutomo.sch.id |
| Prometheus | Metrics collection | Internal |
| Laravel Horizon | Queue management | /portal/horizon |
Key Files
| File | Purpose |
|---|---|
.github/workflows/deploy.yml | CI/CD pipeline definition |
Dockerfile | Production image (multi-stage, ~150MB) |
docker-compose.yml | Production service definitions |
config/octane.php | FrankenPHP worker configuration |