Skip to content

Instantly share code, notes, and snippets.

@leanfj
Created November 26, 2018 13:16
Show Gist options
  • Save leanfj/1b495817e83989e472ae115471aac98b to your computer and use it in GitHub Desktop.
Save leanfj/1b495817e83989e472ae115471aac98b to your computer and use it in GitHub Desktop.
Docker compose for Wordpress + phpmyadmin
version: '2'
services:
wordpress:
depends_on:
- db
image: wordpress:latest
restart: always
volumes:
- ./wp-content:/var/www/html/wp-content
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_PASSWORD: leanfj
ports:
- 80:80
- 443:443
networks:
- back
db:
image: mysql:5.7
restart: always
volumes:
- db_data:/var/lib/mysql2
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: wp_user
MYSQL_PASSWORD: wp_user_pass
MYSQL_DATABASE: wordpress
networks:
- back
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
restart: always
ports:
- 8080:80
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: wp_user_pass
networks:
- back
networks:
back:
volumes:
db_data:
@leanfj
Copy link
Author

leanfj commented Nov 26, 2018

Run docker-compose up --build -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment