Running WP-CLI commands
docker-compose run --rm wpcli [YOUR WPCLI COMMAND]
EXAMPLE: docker-compose run --rm wpcli media regenerate --only-missing
version: '2' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- "./.data/db:/var/lib/mysql" | |
ports: | |
- "[YOUR_DESIRED_SQL_PORT]:3306" | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
wp: | |
depends_on: | |
- db | |
image: wordpress | |
links: | |
- db | |
ports: | |
- "[YOUR_DESIRED_HTTP_PORT]:80" | |
working_dir: /var/www/html | |
volumes: | |
- ./wp-content/:/var/www/html/wp-content | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_PASSWORD: wordpress | |
WORDPRESS_TABLE_PREFIX: "wp_" | |
wpcli: | |
image: wordpress:cli | |
volumes_from: | |
- wp | |
links: | |
- db | |
entrypoint: wp | |
command: "--info" |
Running WP-CLI commands
docker-compose run --rm wpcli [YOUR WPCLI COMMAND]
EXAMPLE: docker-compose run --rm wpcli media regenerate --only-missing