A basic introduction to Docker for DevOps, showcasing how to run WordPress with MySQL using both Docker commands and Docker Compose.
docker-101/
├── README.md
└── basic-docker-for-devops/
├── docker-compose.yml
└── run-containers.sh
docker-compose.yml
: Configuration file for running WordPress and MySQL using Docker Composerun-containers.sh
: Bash script demonstrating how to run the same containers using Docker CLI commands
- Docker installed on your system
- Docker Compose installed (for the Docker Compose method)
-
Navigate to the basic-docker-for-devops directory:
cd basic-docker-for-devops
-
Start the containers:
docker-compose up -d
-
Access WordPress at http://localhost:8000
-
To stop the containers:
docker-compose down
-
Navigate to the basic-docker-for-devops directory:
cd basic-docker-for-devops
-
Make the script executable and run it:
chmod +x run-containers.sh ./run-containers.sh
-
Access WordPress at http://localhost:8000
-
To stop the containers:
docker stop app db
This setup uses Docker volumes to persist data:
- wordpress: Stores WordPress files
- db: Stores the MySQL database
The WordPress installation uses the following database credentials:
- Database name: culiop_demo
- Username: culiop_demo
- Password: culiop_demo
⚠️ WARNING: This code is for tutorial purposes only. Do not use these configurations in production environments.
The WordPress container includes health checks to ensure the application is responding correctly.