version: '3.1'
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: blog
MYSQL_USER: stivenyang
MYSQL_PASSWORD: *******
MYSQL_RANDOM_ROOT_PASSWORD: '*******'
volumes:
- ../mysql/blog/conf/my.cnf:/etc/mysql/my.cnf
- ../mysql/blog/data:/var/lib/mysql
ports:
- 3306:3306
wordpress:
image: wordpress
restart: always
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: stivenyang
WORDPRESS_DB_PASSWORD: ********
WORDPRESS_DB_NAME: blog
volumes:
- ../wordpress:/var/www/html
web:
image: nginx
restart: always
ports:
- 80:80
volumes:
- ../nginx/nginx.conf:/etc/nginx/nginx.conf
- ../nginx/conf.d:/etc/nginx/conf.d