依赖
- mysql
- nginx
yml 文件
version: '3'
services:
nginx:
image: nginx:1.13.9-alpine
ports:
- "80:80"
- "443:443"
restart: always
volumes:
- ./wordpress.conf:/etc/nginx/conf.d/default.conf
- ./nginx_logs:/var/log/nginx
- ./letsencrypt:/etc/letsencrypt
depends_on:
- wordpress
networks:
- daryl_blog_net
wordpress:
image: wordpress:latest
restart: always
volumes:
- ./html:/var/www/html
networks:
- daryl_blog_net
depends_on:
- db
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: password
db:
image: mysql:5.7.23
volumes:
- ./mysql:/var/lib/mysql
- ./mysql_logs:/var/logs/mysql
restart: always
env_file:
- mysql.env
ports:
- "3306:3306"
networks:
- daryl_blog_net
networks:
daryl_blog_net:
driver: bridge
ipam:
config:
- subnet: 192.168.100.0/24