Last active
September 20, 2024 16:50
-
-
Save danielyewright/460477844f9fe7b333f406c6d1f277b1 to your computer and use it in GitHub Desktop.
Docker WordPress Dev
This file contains hidden or 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: | |
# Container 1 | |
# https://hub.docker.com/_/mysql | |
db: | |
image: mysql:5.7 | |
restart: always | |
volumes: | |
- db_data:/var/lib/mysql | |
environment: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
networks: | |
- wp | |
# Container 2 | |
# https://hub.docker.com/_/wordpress | |
wordpress: | |
depends_on: | |
- db | |
image: wordpress:latest | |
restart: always | |
volumes: ["./:/var/www/html/wp-content"] | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
WORDPRESS_CONFIG_EXTRA: | | |
define('FS_METHOD', 'direct'); | |
ports: | |
- 80:80 | |
networks: | |
- wp | |
# Container 3 | |
# https://hub.docker.com/r/phpmyadmin/phpmyadmin | |
phpmyadmin: | |
depends_on: | |
- db | |
image: phpmyadmin/phpmyadmin:latest | |
restart: always | |
ports: | |
- 8080:80 | |
environment: | |
PMA_HOST: db | |
MYSQL_ROOT_PASSWORD: password | |
networks: | |
- wp | |
networks: | |
wp: | |
volumes: | |
db_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Latest for MariaDB