5. Composing Environments with Docker Compose
Activity 5.01: Installing WordPress Using Docker Compose
Solution:
It is possible to create a database and install WordPress with the following steps:
- Create the required directory and navigate into it using
cd
command:mkdir wordpress cd wordpress
- Create a
docker-compose.yaml
file with the following content:version: "3" services: database: image: mysql:5.7 volumes: - data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: db MYSQL_USER: user MYSQL_PASSWORD: password wordpress: depends_on: - database ...