Closed
Description
Hi,
I have the following docker-compose file which uses 'wordpress:cli-php7.4'.
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:
The containers appear to come up but then 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.
I'm wondering is there a working example of a compose file which uses this image? I suspect I need to pass some extra details the 'wp shell' command but am unsure how to achieve this.
Thanks,
emeraldjava