Launching WordPress
Explore how to launch a WordPress site using Docker Compose, from setting up the environment to managing themes and plugins. Understand how to install WordPress, access the admin dashboard, and develop themes locally within the Docker setup.
We'll cover the following...
Launch your WordPress environment
Let’s launch it using:
docker-compose up
Click on the Run button to launch Docker Compose.
📌 You will be able to see the output in the “Output” tab or after clicking on the URL in front of “Your app can be found at:”. Click
OKwhen you see a prompt similar to the image shown on the right side.
After waiting a few seconds you will be able to see a page where you can
📌 If you face any error, refresh the tab as shown below:
version: '3'
services:
mysql:
image: mysql:5
container_name: mysql
environment:
- MYSQL_DATABASE=wpdb
- MYSQL_USER=wpuser
- MYSQL_PASSWORD=wpsecret
- MYSQL_ROOT_PASSWORD=mysecret
volumes:
- wpdata:/var/lib/mysql
ports:
- "3306:3306"
networks:
- wpnet
restart: on-failure
wordpress:
image: wordpress
container_name: wordpress
depends_on:
- mysql
environment:
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_NAME=wpdb
- WORDPRESS_DB_USER=wpuser
- WORDPRESS_DB_PASSWORD=wpsecret
volumes:
- wpfiles:/var/www/html
- ./wp-content:/var/www/html/wp-content
ports:
- "80:80"
networks:
- wpnet
restart: on-failure
volumes:
wpdata:
wpfiles:
networks:
wpnet:The process usually takes several minutes on the first run since Docker must download the images, initialize the database, and copy application files.
A wp-content directory will be ...