Last active
June 10, 2023 04:18
-
-
Save waustin/679422fbe27e7ccb05266039ad06982f to your computer and use it in GitHub Desktop.
Docker Compose File for Wordpress and MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
mysql: | |
container_name: mysql | |
image: mariadb | |
volumes: | |
- ./wp_db_data/:/var/lib/mysql | |
ports: | |
- "8081:3306" | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
wordpress: | |
container_name: wordpress | |
depends_on: | |
- mysql | |
image: wordpress | |
volumes: | |
- ./wordpress/:/var/www/html/ | |
# - ./theme-name/:/var/www/html/wp-content/themes/theme-name | |
# - ./plugin-name/:/var/www/html/wp-content/plugins/plugin-name | |
restart: always | |
ports: | |
- "8080:80" | |
links: | |
- mysql:mysql | |
environment: | |
WORDPRESS_DB_PASSWORD: wordpress | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_NAME: wordpress | |
WP_DEBUG: "true" | |
wpcli: | |
container_name: wp-cli | |
image: tatemz/wp-cli | |
volumes_from: | |
- wordpress | |
links: | |
- mysql:mysql | |
entrypoint: wp | |
command: "--info" | |
# Source This to run wpcli | |
# alias wp="docker-compose run --rm wpcli" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment