☁️ Cloud Hosting & Deployment
November 2023 · React.js · Express.js · AWS · Docker · Redis
🔍 Project Overview
This project involved deploying a multi-service web application on AWS using Docker and Nginx, incorporating Redis caching. The goal was to understand production-level deployment infrastructure and ensure efficient scalability, reliability, and portability for a full-stack app.
⚙️ Methodology
- Dockerisation: Containerised the Node.js backend and React frontend services, and used a Redis container for caching.
- Docker Compose: Configured Compose files to orchestrate multi-container setup with shared network and volumes.
- Nginx: Used Nginx as a reverse proxy to route requests and handle SSL termination.
- AWS EC2: Deployed containers on a t3.micro instance running Ubuntu. Installed Docker and ran the project using scripts.
- Health Checks & Logging: Added basic endpoint checks and logging to monitor uptime and error tracking.
💡 Features
- Redis caching for speed optimisation
- Docker Compose for consistent local & cloud deployment
- SSL configuration and secure routing using Nginx
- Systemd service to ensure auto-start of containers on reboot
📉 Errors & Fixes
ECONNREFUSED errors between services – resolved by using Docker service names as hostnames.
- Redis container not persisting data – added a volume mount for Redis data.
- Permissions issues on EC2 startup – added permission and user checks in shell scripts.
📊 Key Takeaways
- Cloud hosting requires attention to small configuration details that differ between dev and prod environments.
- Docker Compose simplifies orchestration and helps manage microservices.
- Using Redis boosted performance, and adding Nginx enhanced security and control over routing.
🔗 Repository
GitHub Repo: Cloud Hosting Project
← Back to Blog