Write a Docker Compose File

Опубликовано: 29 Июнь 2026
на канале: Otter Tech
18
0

🐳 Docker Level 3 - Day 5: Write a Docker Compose File | Docker Series

Welcome to Day 5 of the Docker Level 3 Series! In this lab, you'll learn how to use Docker Compose to define and deploy a containerized Apache HTTP Server with port and volume mappings.

📌 Lab Objective:
Create a Docker Compose configuration that deploys an Apache web server container, exposes it through a custom host port, and serves website content from a host directory.

🛠️ Task Requirements:

Docker Host:
🔹 App Server 2 (stapp02)

Compose File:
🔹 /opt/docker/docker-compose.yml

Container Details:
🔹 Container Name: httpd
🔹 Image: httpd

Port Mapping:
🔹 Host Port: 8083
🔹 Container Port: 80

Volume Mapping:
🔹 Host Path: /opt/finance
🔹 Container Path: /usr/local/apache2/htdocs

Requirements:
🔹 Deploy the container using Docker Compose
🔹 Do not modify existing website content

💻 What You’ll Configure & Verify:

🔹 Create Docker Compose files
🔹 Define services using YAML
🔹 Deploy containers with Docker Compose
🔹 Configure port mappings
🔹 Configure volume bindings
🔹 Serve static website content
🔹 Verify container status
🔹 Test web application accessibility

📚 What You’ll Learn:

Docker Compose
Container Orchestration
YAML Configuration
Port Mapping
Volume Mapping
Apache HTTP Server
Infrastructure as Code
Multi-Service Management

🌟 Why This Lab Matters:
Docker Compose simplifies container deployment by allowing infrastructure configurations to be defined as code. It is widely used for application development, testing, and managing containerized workloads in a consistent and repeatable manner.

🎯 Series: Docker Level 3 Series
Master advanced Docker concepts through hands-on labs and real-world infrastructure scenarios.

🔔 Follow OtterTech for more Docker, Kubernetes, Jenkins, AWS, Azure, Linux, Monitoring, and DevOps tutorials!

#Docker #DockerCompose #Containers #Apache #HTTPD #YAML #DevOps #Containerization #InfrastructureAsCode #Linux #DockerLevel3 #OtterTech #CloudComputing #Automation