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, 2020 in Docker by akhtar
• 38,260 points
1,004 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, 2020 by MD
• 95,460 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,890 points
3,001 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
• 52,350 points
4,724 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
• 52,350 points
930 views
+2 votes
1 answer
+2 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
• 58,020 points
2,739 views
+3 votes
4 answers

How do I execute multiple commands using docker-compose

It can be solve by using bash -c ...READ MORE

answered Sep 20, 2018 in Docker by shubham
• 7,340 points
110,948 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, 2020 in Docker by MD
• 95,460 points
2,023 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP