Docker Compose with Nginx
📖 Scenario: You want to run a simple web server using Nginx inside a Docker container. To make it easy to start and stop, you will use Docker Compose to manage the container.This project will guide you to create a Docker Compose file that runs Nginx and serves a basic web page.
🎯 Goal: Build a Docker Compose setup that runs an Nginx container serving a simple HTML page on your local machine.
📋 What You'll Learn
Create a Docker Compose YAML file named
docker-compose.ymlDefine a service named
web that uses the official nginx:latest imageMap port
8080 on your machine to port 80 in the containerMount a local directory
./html to /usr/share/nginx/html inside the containerCreate an
index.html file inside ./html with the text Hello from Nginx!💡 Why This Matters
🌍 Real World
Docker Compose is widely used to run multiple containers easily. Nginx is a popular web server to serve websites or act as a reverse proxy.
💼 Career
Understanding Docker Compose and Nginx is essential for DevOps roles to deploy and manage web applications efficiently.
Progress0 / 4 steps