Skip to content

Week 5 ‐ Docker Lamp Stack

Michaelfoop edited this page Sep 30, 2026 · 4 revisions

Docker Compose LAMP Stack

docker-compose.yml with MySQL, PHP/Apache, volumes, networking, and working curl test

image image

Teraform Provider and Resources

main.tf with kreuzwerker/docker provider, docker_network, docker_volume, docker_image, docker_container resources

image image image

Variables and Student Isolation

variables.tf with student_name validation, web_port, mysql credentials; terraform.tfvars with personal settings

image

Scaling with count

web container uses count parameter; web_count variable controls container count; ports scale with count.index

image

Deployment and Verification

terraform init/plan/apply succeeds; all containers running; curl returns success; terraform destroy cleans up

image image {E3122641-38B8-46BC-8EED-748AB373BE32}

GitHub Push

lamp-stack-terraform/ pushed to GitHub with .gitignore excluding .terraform/ and terraform.tfvars

  • done

POST LAB CHANGES

I reenabled apparmor with: sudo status enable apparmor

Clone this wiki locally