Docker Compose will BLOW your MIND!! (a tutorial)

About this video

A hands-on Docker Compose tutorial that contrasts the old way — long docker run commands for each container — with defining an entire stack in one docker-compose.yml file and launching or destroying it with a single command. He installs Docker and Docker Compose on Linux, recreates a simple Nginx container in YAML (image, a host-to-container port mapping, and restart: always), then runs it with docker compose up -d, checks it with docker compose ps, and shows the difference between stop and down, noting that Compose also creates a default network automatically. He then adds a second container and a custom network defined in the same file, with IP address management settings, a subnet, and a fixed IPv4 address for one container. The main worked example is WordPress: a WordPress service paired with a MySQL 5.7 service, connected through matching environment variables for database host, name, and credentials, ordered with depends_on so the database starts first, and made persistent with a volume that maps the database directory to the host so data survives teardown. He closes by applying the same pattern to a much larger prebuilt file — a Kali Linux hacking lab that, in his opening demonstration, spins up many containers across multiple networks at once — and points to other composable projects as inspiration.

Key takeaways

  • The compose file is essentially your docker run commands rewritten in YAML: services, image, ports, and restart policy in one place, launched with docker compose up -d from the file’s directory
  • Compose names resources after the project folder and service, and creates a default bridge network for the stack unless you define your own networks in the file
  • Use depends_on to control startup order when one service needs another, such as WordPress needing its database first
  • Use volumes to map container data directories onto the host so databases and other state survive docker compose down and recreation
  • docker compose stop merely halts containers, while docker compose down removes the containers and their networks

Episode details: published August 31, 2022 · 16:26 long. Summary written by Self Growth Videos from the episode itself. Business results and any income figures mentioned are NetworkChuck’s own claims, shared for education — they are not typical or guaranteed.


← Previous: How YouTubers Get Hacked · Next: let’s subnet your home network // You SUCK at subnetting // EP 6 →

All NetworkChuck videos · NetworkChuck profile · NetworkChuck on YouTube

Sister brand · Vacation Club Promo

All-inclusive resort stays from $435

Qualified couples: promotional Mexico and Caribbean packages at real resorts. Short presentation during your stay — enjoy the rest of the trip.

Qualifications apply · presentation during stay · no purchase required

Subscribe YouTube Suggest