Last active
March 28, 2017 10:27
-
-
Save ezaki/d4865c085df161d3f9aa760a55224b67 to your computer and use it in GitHub Desktop.
Wordpress docker compose
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: '3.1' | |
services: | |
database: | |
image: mariadb:10.1 | |
expose: | |
- 3306 | |
volumes: | |
# データベース上のデータを保存する必要がなければ削除して良い | |
- ./volumes/database:/var/lib/mysql | |
environment: | |
MYSQL_DATABASE: "wordpress" | |
MYSQL_USER: "wordpress" | |
# ローカルでの検証用のためパスワードを平打ちしているが、.envファイルなどで別途管理するのが望ましい | |
MYSQL_PASSWORD: "cakeisalie" | |
MYSQL_RANDOM_ROOT_PASSWORD: "true" | |
wordpress: | |
depends_on: | |
- database | |
image: wordpress:4.7-apache | |
ports: | |
- "80:80" | |
volumes: | |
- ./wordpress:/var/www/html | |
# wordpress ファイルの全てが必要でないのであれば、特定のフォルダのみ同期させても良い | |
# - ./volumes/wordpress/themes:/var/www/html/wp-content/themes | |
# - ./volumes/wordpress/plugins:/var/www/html/wp-content/plugins | |
# - ./volumes/wordpress/uploads:/var/www/html/wp-content/uploads | |
environment: | |
WORDPRESS_DB_HOST: "database:3306" | |
WORDPRESS_DB_USER: "wordpress" | |
WORDPRESS_DB_PASSWORD: "cakeisalie" | |
WORDPRESS_DB_NAME: "wordpress" | |
restart: "always" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment