PetCare
Pet-health platform.
My role: I designed and built the AWS infrastructure, CI/CD and deployments. The application code was written by the dev teams.
Context
PetCare is a pet-health platform. It runs as a containerized web application backed by a separate background-worker service that handles asynchronous jobs such as outbound email.
The problem
The platform needed somewhere reliable to run two separate workloads — the web app and its background worker — from the same image pattern, with credentials kept out of the image. Transactional email had to actually reach inboxes rather than spam folders, and when a send failed the team needed to see it without SSH-ing into a host. It also needed a staging environment that mirrored production so changes could be validated before they went live.
Architecture
What I built
Compute
- The web application runs as an ECS service (
petcare) on AWS Fargate. - The Sidekiq background worker runs as a separate ECS Fargate service (
petcare-sidekiq), built from the same image pattern. - A staging environment mirrors production —
petcare-stagingandpetcare-sidekiq-staging.
CI/CD
- GitHub Actions builds the Docker image on each push and pushes it to Amazon ECR.
- The same workflow then updates the ECS service to the new task definition, and ECS rolls the new task in with minimal downtime.
Security
- Secrets Manager holds credentials, injected into the task definitions at runtime rather than baked into the image.
- TLS configured for the application.
- Transactional email sent through Amazon SES.
- SPF, DKIM and DMARC set up for deliverability so mail authenticates correctly.
Observability
- Application and worker logs stream to CloudWatch Logs.
- Failed email sends are made visible in CloudWatch, so issues can be found without SSH-ing into any host.
Deploy flow
- Push to GitHub on the application repository.
- GitHub Actions builds the Docker image for the web app and Sidekiq worker.
- The workflow pushes the image to Amazon ECR.
- It then updates the ECS (Fargate) service with the new task definition.
- ECS rolls the new task in with minimal downtime, keeping staging (
petcare-staging/petcare-sidekiq-staging) ahead of production.
Security decisions
Secrets in Secrets Manager, not the image
Credentials are injected into the task definitions at runtime. The image stays free of secrets, and credentials can rotate without rebuilding it.
TLS for the application
Traffic to the app is served over TLS.
Authenticated email with SPF, DKIM and DMARC
Email sent through SES is signed and aligned so receiving servers can verify it — protecting deliverability and the sending domain's reputation.
Staging mirrors production
A separate staging environment (petcare-staging, petcare-sidekiq-staging) lets changes be validated before they reach production.
Challenges & fixes
Email landing reliably
Set up SPF, DKIM and DMARC and aligned them so SES mail authenticates against the sending domain, keeping transactional email out of spam folders.
Seeing failed sends without SSH
Surfaced failed email sends in CloudWatch Logs, so delivery problems can be diagnosed from the logs instead of connecting into a running host.
What's next
- Stand up a dedicated production environment alongside the existing staging environment, so the two no longer share footprint.
- Add CloudWatch alarms on failed email sends, turning the existing log visibility into proactive alerting.
- Move SES out of the sandbox so sending is no longer limited to verified recipients.
- Autoscale the ECS Fargate services on CPU and memory so capacity follows demand.