...

/

Launching WordPress

Launching WordPress

Let's launch WordPress, view the default site, and then make our own theme.

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 OK when you see a prompt similar to the image shown on the right side.

Prompt

After waiting a few seconds you will be able to see a page where you can select language for WordPress.WPdefualt

๐Ÿ“Œ 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:
Launching WordPress

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 created ...

Add terminal option
Access this course and 1400+ top-rated courses and projects.