官方文档,演示站点:https://tu.cddone.com
部署
部署Docker教程:https://bj.cddone.com/doc/14
1、创建工作目录
mkdir -p /home/docker/lsky && cd /home/docker/lsky
2、创建wordpress容器yaml
vim docker-compose.yaml
- 参数说明:
- 设置镜像
- 设置容器名称
- 设置容器自启动
- 映射端口
- 映射目录
version: '3.9'
services:
lsky-pro:
image: dko0/lsky-pro
container_name: lsky
restart: always
volumes:
- /home/docker/lsky/html:/var/www/html
ports:
- 8088:80
environment:
- MYSQL_DATABASE=lsky
- MYSQL_USER=lsky
- MYSQL_PASSWORD=lsky
mysql:
image: mysql:8.0
container_name: mysql
restart: always
environment:
- MYSQL_DATABASE=lsky
- MYSQL_USER=lsky
- MYSQL_PASSWORD=lsky
- MYSQL_ROOT_PASSWORD=lsky
volumes:
- /home/docker/lsky/db:/var/lib/mysql
3、启动wordpress容器
docker-compose up -d
4、查看容器状态
docker ps
5、设置nginx反向代理
server {
listen 443 ssl;
server_name tu.cddone.com;
#ssl on;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
#access_log /var/log/nginx/api-dev.log;
#error_log /var/log/nginx/api-dev.error.log;
location / {
proxy_pass http://localhost:8088;
proxy_set_header Host $host:443;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 150;
proxy_send_timeout 100;
proxy_read_timeout 100;
proxy_buffers 4 32k;
client_max_body_size 100m;
client_body_buffer_size 128;
}
}
6、修改页脚
- 修改配置文件
vim /home/docker/lsky/html/resources/views/welcome.blade.php
- 添加代码
<div class="layui-footer" style="border-top: 1px ;text-align:center;margin-top:1px;width:100%;">
<div style="margin-top:1px;padding-bottom: 1px;">
<a href="https://cddone.com" target="_blank"> 我的导航 </a>
| <a href="https://cddone.com/blog" target="_blank"> 我的博客 </a>
| <a href="https://bj.cddone.com" target="_blank"> 我的笔记 </a>
| <a href="https://pan.cddone.com" target="_blank"> 我的网盘 </a>
<br>
<a href="https://tu.cddone.com" target="_blank"> 我的图床 </a>
| <a href="https://jk.cddone.com" target="_blank"> 我的监控 </a>
| <a href="https://tv.cddone.com" target="_blank"> 我的影院 </a>
| <a href="https://tu.cddone.com/login" target="_blank"> 用户登录 </a>
<br>
上传图片请您遵守当地法律法规
<br>
Copyright © 2023 CDDONE
</div>
</div>
7、修改图标
ls /home/docker/lsky/html/public/favicon.ico
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...