Z
Z
ZaurK2018-10-16 17:56:13
WordPress
ZaurK, 2018-10-16 17:56:13

How to set up docker for wordpress?

Greetings, dear developers!
There was a need to install wordpress on docker and used the docker-compose.yml file from the documentation , supplementing it with a block for phpmyadmin:

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: wpphpmyadmin
    links:
        - "db:db"
    environment:
        MYSQL_USER: wordpress
        MYSQL_ROOT_PASSWORD: somewordpress
    restart: always
    ports:
        - "8080:80"
    volumes:
        - "/sessions"

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
volumes:
    db_data:

I launched, installed wordpress, all libraries, containers were installed, the site is displayed and I can go to phpmyadmin. But there was a problem related to the fact that there is no correspondence between the local and guest versions of the site. That is, changes to the files are not displayed on the site in the container. I went inside the container from the command line, I look at the contents and there really is no connection. I ask you to tell me how to properly configure the volumes so that you can work and see the changes?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vladryjoff, 2020-04-17
@vladryjoff

The problem is that you don't really edit the files in the container, to work with the contents of the container there is a great plugin for Visual Studio Code Extremely clear instructions.
https://marketplace.visualstudio.com/items?itemNam...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question