Hey everyone! I'm running a small software consultancy and I currently have several projects in containers on a single EC2 instance. However, I've noticed that Docker is consuming a lot of resources, which is impacting performance. I'm trying to find ways to host multiple small web apps – including APIs and frontends – on an EC2 instance without the Docker overhead. I'm looking for alternatives that are cost-effective, similar to App Runner. What strategies do you recommend for running multiple Node.js apps on a single EC2 instance without using Docker?
3 Answers
One option is to run your Node.js applications on different ports and use Nginx as a reverse proxy to manage the frontend and backend routes. This way, you can keep everything organized while serving all requests through a single Nginx instance. It's pretty straightforward and doesn't require container overhead!
It sounds like Docker isn’t the real issue here since it actually has minimal overhead. If you want to run multiple apps without Docker, you could just run them directly on the EC2 instance. You could assign different ports for each app, which is straightforward. Just keep in mind that managing this setup isn't as modern or efficient as using containers.
Honestly, Docker is probably your best option even if it sounds counterintuitive. If you're worried about resource usage due to overeating images, consider switching to smaller base images like Alpine. This can help reduce the footprint of your containers. If cost is an issue, you might want to look into a dedicated server instead of EC2; they can offer better resources for less money, even if it means losing some of the scalability benefits of the cloud.
That sounds like a solid plan! Using Nginx would definitely help streamline requests, and it’s a lightweight way to manage multiple apps.