Docker compose with wordpress:cli-php7.4 stalls on ‘The site you have requested is not installed’?

I have the following docker-compose.yml file where i’m using the wordpress:cli-php7.4 to get the core wordpress and wp-cli image.

version: '3'
services:
  wordpress:
    depends_on:
      - db
    image: wordpress:cli-php7.4
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - /home/dc-user/github/wordpress:/var/www/html
    ports:
      - 8080:80
    networks:
      - back
  db:
    image: mysql:5.7
    restart: always
    volumes:
      - db_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
    networks:
      - back
  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - 8001:80
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: somewordpress
    networks:
      - back
networks:
  back:
volumes:
  db_data:

I start the containers with this command

docker-compose -f docker-compose.yml up -d

Using portainer i see that three containers are created as expected and appear to be running. When I check the logs of the wordpress container i see this error

Error: The site you have requested is not installed.
Run `wp core install` to create database tables.

Attempting to open a CLI to the container says that it’s still restarting. Is there some extra command or information i need to provide?

0

Leave a Comment