This repository contains a Strapi application configured to build and deploy Docker images to AWS ECR in the Ohio region (us-east-2).
This repository serves a single purpose: Build a Docker image of Strapi and publish it to the ECR repository on AWS Ohio.
- AWS CLI configured with appropriate permissions
- Docker installed
- AWS Account ID set as environment variable
-
Set your AWS Account ID:
export AWS_ACCOUNT_ID=your-account-id -
Ensure AWS CLI is configured:
aws configure
-
Login to ECR:
./scripts/ecr-login.sh
-
Build and push to ECR:
./scripts/ecr-build-and-push.sh [tag]
The repository includes a GitHub Actions workflow (.github/workflows/ecr-deploy.yml) that automatically builds and pushes Docker images to ECR when code is pushed to the main/master branch.
Required GitHub Secrets:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
- Region: us-east-1 (N. Virginia) (for Prod)
- Region: us-east-2 (Ohio) (for staging)
- Repository Name: silq-strapi
- Image URI:
{AWS_ACCOUNT_ID}.dkr.ecr.{REGION}.amazonaws.com/silq-strapi
- Based on Node.js 18 Alpine
- Non-root user for security
- Health check endpoint
- Production optimizations
- Signal handling with dumb-init
The Docker image expects these environment variables:
NODE_ENV=productionHOST=0.0.0.0PORT=1337
The container includes a health check that verifies the application is responding on port 1337.