0

I've seen responses for similar errors, but nothing that seems to address a solution that will work for me.

I've got a wordpress site that I've imported into docker following this tutorial. I've got everything down to the final part where I'm supposed to "docker compose up" and I'm getting the error listed in the subject line. Here is my .yml file:

version: "2"

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

    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:
            - ./public_html/wp-content/themes/oceanwp:/var/www/html/wp-content/themes/oceanwp
            - ./public_html/wp-content/plugins:/var/www/html/wp-content/plugins
            - ./public_html/wp-content/mu-plugins:/var/www/html/wp-content/mu-plugins
volumes:
    - ./data:/docker-entrypoint-initdb.d
Toph
  • 59
  • 8

1 Answers1

1

I was wondering why your yml file is different from the one in the post. I use the yml file in the post and it does work.

Remember that you can’t map a top-level volume in docker-compose , so blow is illegal, see link and link for more help. volumes: - ./data:/docker-entrypoint-initdb.d

lin
  • 1,425
  • 1
  • 19
  • 27