Created
November 23, 2020 23:14
-
-
Save andriyudatama/5fcf5bdc8c77923ae54c03771493480a to your computer and use it in GitHub Desktop.
Docker Compose Wordpress + Mysql + PhpMyAdmin
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: | |
# Database | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
networks: | |
- wpsite | |
# PhpMyAdmin | |
phpmyadmin: | |
depends_on: | |
- db | |
image: phpmyadmin/phpmyadmin | |
restart: always | |
ports: | |
- '8888:80' | |
environment: | |
PMA_HOST: db | |
MYSQL_ROOT_PASSWORD: password | |
networks: | |
- wpsite | |
# Wordpress | |
wordpress: | |
depends_on: | |
- db | |
image: wordpress:latest | |
ports: | |
- '8000:80' | |
restart: always | |
volumes: ['./wordpress:/var/www/html'] | |
environment: | |
WORDPRESS_DB_HOST: db | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
WORDPRESS_DB_NAME: wordpress | |
networks: | |
- wpsite | |
networks: | |
wpsite: | |
volumes: | |
db_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment