Created
May 31, 2020 15:43
-
-
Save aidnurs/315261f2148ac5138831a1e27524c94c to your computer and use it in GitHub Desktop.
Docker-compose for Wordpress+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.5' | |
services: | |
db: | |
container_name: db | |
image: mariadb:latest | |
volumes: | |
- ./run/var:/var/lib/mysql | |
- ./run/dump/:/docker-entrypoint-initdb.d/ # mount initial sql dump to container | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
wordpress: | |
container_name: wordpress | |
depends_on: | |
- db | |
image: wordpress:latest | |
ports: | |
- '8000:80' | |
restart: always | |
volumes: | |
- ./:/var/www/html | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
WORDPRESS_DB_NAME: wordpress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment