Docker Community Forums

Share and learn in the Docker community.

Docker Compose WordPress Volumes Appear Empty


(Myrmidon16) #1

I’m trying to set up a simple WordPress build using docker compose. However, when I build it, the volumes I set appear to be empty, though their local versions have contents.

Here is my docker-compose.yml:

version: '3'
services:
    wordpress:
        image: wordpress
        restart: always
        ports:
            - 8000:80
        volumes:
            - ./development:/var/www/html
        environment:
            WORDPRESS_DB_HOST: db
            WORDPRESS_DB_NAME: wordpress
            WORDPRESS_DB_USER: root
            WORDPRESS_DB_PASSWORD: password
        depends_on:
            - db
        networks:
            - wordpress-network
    phpmyadmin:
        image: phpmyadmin/phpmyadmin:latest
        ports:
            - 8080:80
        links:
            - db:db
    db:
        image: mariadb:latest
        ports:
            - 3307:3306
        command: [
            '--default_authentication_plugin=mysql_native_password',
            '--character-set-server=utf8mb4',
            '--collation-server=utf8mb4_unicode_ci'
        ]
        volumes:
            - wp-data:/var/lib/mysql
        environment:
            MYSQL_DATABASE: wordpress
            MYSQL_ROOT_PASSWORD: password
        networks:
            - wordpress-network
networks:
    wordpress-network:
        driver: bridge

volumes:
    wp-data:
        driver: local

Here is a screenshot of my local project structure, with theme stylesheet: https://i.stack.imgur.com/FSgGL.png

I run docker-compose to build the image: docker-compose up -d --build

But when I open the build in my browser, it looks like the theme is empty: https://i.stack.imgur.com/YPksA.png

And when I SSH onto the container, the contents are empty.

Some more information about my environment:

  • Windows 10 Pro v1709
  • Docker for Windows Community Edition v18.03.1-ce
  • Docker version 1.13.1, build 092cba3
  • docker-compose version 1.21.2, build a133471

(Jediknight) #2

Same. Did you find a solution?