Skip to content

Instantly share code, notes, and snippets.

@trinnguyen
Created September 10, 2022 10:53
Show Gist options
  • Save trinnguyen/fb96979fe2af7520064013387607d249 to your computer and use it in GitHub Desktop.
Save trinnguyen/fb96979fe2af7520064013387607d249 to your computer and use it in GitHub Desktop.
A docker compose that just works with Wordpress + MariaDB
services:
db:
image: mariadb
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=somewordpress
- MYSQL_DATABASE=wordpress
- MYSQL_USER=wordpress
- MYSQL_PASSWORD=wordpress
expose:
- 3306
- 33060
wordpress:
image: wordpress
ports:
- 9090:80
restart: always
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=wordpress
- WORDPRESS_DB_NAME=wordpress
volumes:
db_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment