How to configure wordpress tool using docker-compose?

0 votes

Hi Guys,

I am new in docker-compose concept. Can anyone help me how to configure wordpress server using docker-comopse?

Apr 24 in Docker by akhtar
• 11,270 points
88 views

1 answer to this question.

0 votes

Hi@akhtar,

You can download wordpress image from docker hub. WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL database. So in back end wordpress requires MySQL as well. You can use the below given code to implement your task.

version: '3.1'
services:
  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb
    volumes:
      - wordpress:/var/www/html
  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
      MYSQL_RANDOM_ROOT_PASSWORD: '1'
    volumes:
      - db:/var/lib/mysql
volumes:
  wordpress:
  db:

Write this code a docker-compose.yml file and run that file using the below given command.

$ docker-compose up
answered Apr 24 by MD
• 24,500 points

Related Questions In Docker

0 votes
1 answer

How to send docker using terraform to aws cloudwatch?

Check if you set all the permissions ...READ MORE

answered Jun 7, 2018 in Docker by DareDev
• 6,850 points
703 views
0 votes
2 answers
0 votes
1 answer

How to get docker-compose to always re-create containers from fresh images?

The containers are getting recreated to preserve ...READ MORE

answered Jul 27, 2018 in Docker by Kalgi
• 51,850 points
1,651 views
0 votes
1 answer

How to remove docker installed using wget

The uninstallation step mentions: sudo apt-get purge -y docker-engine sudo apt-get ...READ MORE

answered Jul 30, 2018 in Docker by Kalgi
• 51,850 points
100 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,530 points
542 views
0 votes
1 answer

configure mysql database using docker-compose.

Hi@akhtar, To configure mysql database using docker-compose, you ...READ MORE

answered Apr 14 in Docker by MD
• 24,500 points
163 views
0 votes
1 answer

How to configure docker to use proxy?

Hi@akhtar, You can configure proxy variables in the /etc/sysconfig/docker ...READ MORE

answered May 12 in Docker by MD
• 24,500 points
32 views