Last active
April 19, 2024 07:14
-
-
Save altbdoor/ef83be3afeffc52c9e670c0a49733991 to your computer and use it in GitHub Desktop.
Docker compose for Wordpress and MariaDB
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.9" | |
# borrowed from | |
# https://github.com/docker/awesome-compose/blob/master/wordpress-mysql/compose.yaml | |
services: | |
db: | |
# https://make.wordpress.org/hosting/handbook/compatibility/#wordpress-php-mysql-mariadb-versions | |
image: mariadb:11.3 | |
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: | |
# alpine images would need nginx to act as the "server" | |
image: wordpress:6.5-php8.3-apache | |
ports: | |
- "8000: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