Build a simple local multi-container setup with Node.js and Redis using Docker Compose, then verify connectivity and logs.
Understand multi-service local environments, container networking, and service startup validation.
Create or use a small Node.js app that connects to Redis.
Create a simple Node.js app
Add Redis dependency
Verify the app can connect using environment variables
Create the Compose file and describe both services.
Create docker-compose.yml
Define Node.js service
Define Redis service
Expose the application port
Add environment variables if needed
Start the stack and verify that both services work together.
Run docker-compose up
Check containers with docker ps
Inspect logs
Test application endpoint
Create a small Node.js app that uses Redis.
Write a docker-compose.yml file.
Start both services with docker-compose up.
Check logs and connectivity.
Document the setup and validation.
docker ps shows both containers running
The Node.js app responds successfully
Logs show successful Redis connection
docker-compose down stops and removes the stack
docker-compose.yml
Node.js app source
README with startup and test steps
Shows that you understand how multi-container services communicate and how local development environments are structured.
Using localhost instead of service name for Redis connection
Forgetting to expose the app port
Starting only one service manually instead of using Compose
Missing environment variables
Add PostgreSQL as another service
Add healthchecks for both containers
Use volumes for persistent Redis data
Deploy the same stack to a VM