version: '3'
services:
wp:
container_name: jointly-wp
restart: always
image: wordpress:latest # https://hub.docker.com/_/wordpress/
ports:
- ${IP}:80:80 # change ip if required
volumes:
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
- ./wp-app:/var/www/html # Full wordpress project
#- ./plugin-name/trunk/:/var/www/html/wp-content/plugins/plugin-name # Plugin development
#- ./theme-name/trunk/:/var/www/html/wp-content/themes/theme-name # Theme development
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: "${DB_NAME}"
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: "${DB_ROOT_PASSWORD}"
depends_on:
- db
links:
- db
# wpcli:
# restart: always
# image: wordpress:cli
# volumes:
# - ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
# - ./wp-app:/var/www/html
# depends_on:
# - db
# - wp
# pma:
# container_name: jointly-pma
# restart: always
# image: phpmyadmin/phpmyadmin
# environment:
# PMA_HOST: db
# PMA_PORT: 3306
# MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
# ports:
# - ${IP}:8088:80
# links:
# - db:db
db:
container_name: jointly-db
restart: always
image: mysql:latest # https://hub.docker.com/_/mysql/ - or mariadb https://hub.docker.com/_/mariadb
ports:
- ${IP}:3306:3306 # change ip if required
deploy:
resources:
limits:
memory: 200M ### limit the memory usage, only worked when use docker stack deploy or docker-compose --compatibility up
reservations:
memory: 100M
command: [
'--default_authentication_plugin=mysql_native_password',
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci'
]
volumes:
- ./wp-data:/docker-entrypoint-initdb.d
- ./wp-data/db-data:/var/lib/mysql
environment:
MYSQL_DATABASE: "${DB_NAME}"
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
WordPress docker-compose 配置
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- docker-compose启动wordpress 作者:hdig1007 时间:2017年12月09日18:42...
- 1)docker-compose version: '3'services: mysql: image: mys...
- 学习过docker-compose的基本语法之后,参照指导书上的例程搭建wordpress博客系统。系统主要包括3...