docker部署
docker-compose.yml
文件内容:
version: '3.8'
services:
mysql:
image: mysql
container_name: mysql
volumes:
- /data/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ROOT数据库密码
MYSQL_DATABASE: 数据库名称
MYSQL_USER: 数据库用户名
MYSQL_PASSWORD: 数据库密码
restart: always
ports:
- "3306:3306"
wordpress:
image: wordpress:php8.1-fpm-alpine
restart: always
container_name: wordpress
environment:
- TZ=Asia/Shanghai
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_USER=数据库用户名
- WORDPRESS_DB_PASSWORD=数据库密码
- WORDPRESS_DB_NAME=数据库名称
volumes:
- /data/nginx/html:/var/www/html:rw
ports:
- "9000:9000"
links:
- mysql
nginx:
image: nginx:1.22.0-alpine
container_name: nginx
restart: always
environment:
- TZ=Asia/Shanghai
ports:
- "80:80"
- "443:443"
volumes:
- /data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- /data/nginx/cert:/etc/nginx/cert
- /data/nginx/logs:/etc/nginx/logs
- /data/nginx/html:/var/www/html:rw
links:
- wordpress
nginx.conf
不提供
评论