Best practices for setting up automated deployment pipeline with Docker containers on AWS EC2 free tier?

I’m new to DevOps and trying to figure out the right way to automate deployments for my web app.

My current setup:

  • React frontend and Node.js backend running in separate Docker containers
  • Everything deployed on a single AWS EC2 free tier instance
  • Jenkins builds the code and pushes artifacts to S3 bucket
  • AWS CodeDeploy pulls from S3 and handles the deployment
  • Apache reverse proxy to manage incoming traffic

Questions I have:

  • Does this approach make sense for a small full-stack app on EC2 free tier?
  • I’m running into storage space problems on my EC2 instance. Could the Jenkins → S3 → CodeDeploy → Docker workflow be causing this?
  • What are some recommended patterns for keeping CI/CD lightweight on free tier EC2?

This is just a learning project but I want it to stay stable long term without breaking.


Looking for suggestions to optimize this setup or resources to learn more about managing deployment pipelines on EC2.

for sure, storage issues r common. elastic beanstalk can help ur setup scale better without too much hassle. it might save u some headache compared to managing everything manually. worth checking out!

Your storage problems are probably from Docker images piling up and Jenkins eating disk space. Running Jenkins plus your app containers on a t2.micro is asking for trouble - there’s just not enough room. Set up docker system prune on a cron job to automatically clear out unused images and containers. Honestly though, you might want to ditch Jenkins and use AWS CodePipeline with CodeBuild instead. No more build stuff hogging your instance. If you stick with Jenkins, use multi-stage Docker builds to shrink your images and make sure Jenkins cleans up workspaces after each build. Your setup’s fine for learning, but definitely add CloudWatch alarms to watch disk usage - you don’t want your instance crashing when storage maxes out.

what’s ur jenkins setup like? running it on the same ec2 instance? that’ll chew through disk space fast - build artifacts and docker images add up quick. ever consider github actions? way lighter for learning projects.