Created
February 10, 2021 08:39
-
-
Save blockworks/55a877229e74cc338489026916c14ddb to your computer and use it in GitHub Desktop.
DockerでWordpress
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' | |
services: | |
mysql: #コンテナ名 | |
image: mysql:5.7 | |
volumes: | |
- ./mysql:/docker-entrypoint-initdb.d | |
- ./mysql/db-data:/var/lib/mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=password | |
- MYSQL_DATABASE=wordpress_db | |
phpmyadmin: #コンテナ名 | |
image: phpmyadmin/phpmyadmin | |
environment: | |
- PMA_ARBITRARY=1 | |
- PMA_HOST=mysql | |
- PMA_USER=root | |
- PMA_PASSWORD=password | |
links: | |
- mysql | |
ports: | |
- 1234:80 | |
wordpress: #コンテナ名 | |
image: wordpress:latest | |
depends_on: | |
- mysql | |
ports: | |
- 80:80 | |
volumes: | |
- ./wordpress:/var/www/html/ | |
environment: | |
- WORDPRESS_DB_HOST=mysql | |
- WORDPRESS_DB_PASSWORD=password | |
- WORDPRESS_DB_NAME=wordpress_db |
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
//環境の構築 | |
$ docker-compose build | |
//コンテナの構築、及び起動 | |
$ docker-compose up | |
//コンテナの停止 | |
$ docker-compose down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment