Home > Net >  Where Docker stores files of images on Windows 10?
Where Docker stores files of images on Windows 10?

Time:10-15

I work with WordPress and now I try to create WP site with Docker. However, I already have folder called 'wp-content' (with my old content) and I have to put it into new one (which I have just created with docker-compose.yml). But I don't understand where docker stores all theses files (ex. wp-admin, wp-content, wp-includes).

I have folder called wordpress-docker where I store my docker-compose.yml but it's empty (I thought that new folders will appear here).

Here's my docker-compose.yml:

version: "3.9"
    
services:
  db:
    image: mysql:8.0
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_PASSWORD: wordpress
    
  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    volumes:
      - wordpress_data:/var/www/html
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
volumes:
  db_data: {}
  wordpress_data: {}

P.S: tried this article: enter image description here

Then you can manipulate all the files locally and find the same content/structure inside the container.

PS : I've got a right access issue : I can't maniuplate the folder locally, so I've forced the folder rights.

You can also change nothing and add this :

    volumes:
      - wordpress_data:/var/www/html
      - ./wordpress_data:/var/www/html/wp-content

Your local folder wordpress_data will 'point' to wp-content inside the container which is empty by default.

  • Related