docker应用练习
2023-02-18 16:46:00 时间
docker搭建与typecho部署练习
目标:部署typecho博客系统
1 git拉取代码(dnmp:docker编排,要点开按照文档一通操作)
github地址: https://github.com/yeszao/dnmp
如果没有git则先安装即可。拉取指定tag版代码,这里以v1.1-17.10.30 为例
git clone --branch [tags标签] [git远程仓库地址]
git clone --branch v2.0.5 git@github.com:yeszao/dnmp.git
2 环境安装(mac不需要这一步,直接docker-desktop)
安装docker引擎
https://docs.docker.com/engine/install/centos/#install-using-the-repository
3 安装docker-compose
https://docs.docker.com/compose/install/
https://docs.docker.com/compose/install/compose-plugin/#installing-compose-on-linux-systems
4 docker编排(注意mysql版本,dnmp这个比较高,typecho不支持8.0)
https://github.com/yeszao/dnmp
mac环境怎么体验?
mac环境无需上述两步,直接下载docker desktop即可:ps:自动支持docker engine 与 docker-compose
https://docs.docker.com/desktop/mac/install/
5 typecho 代码拉取(最好拉取稳定版本)
git clone --branch [tags标签] [git远程仓库地址]
git clone --branch v1.1-17.10.30-release git@github.com:typecho/typecho.git
6 typecho常见问题
先预创建一个typecho库
数据库连接参数:host:mysql5 user:root pwd:123456
7 nginx配置目录到typecho对应目录
server {
listen 80;
server_name localhost;
root /www/build/;
index index.html index.htm index.php;
access_log /dev/null;
#access_log /var/log/nginx/nginx.localhost.access.log main;
error_log /var/log/nginx/nginx.localhost.error.log warn;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
fastcgi_pass php:9000;
#include fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 443 default ssl http2;
server_name localhost;
root /www/build/;
index index.php index.html index.htm;
access_log /dev/null;
error_log /var/log/nginx/nginx.localhost.error.log warn;
ssl_certificate /ssl/localhost/localhost.crt;
ssl_certificate_key /ssl/localhost/localhost.key;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
fastcgi_pass php:9000;
#include fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
8 开启你的博客之旅(我直接用的ip访问)
9 相关参考git仓库
typecho:
https://github.com/typecho/typecho
dnmp:
https://github.com/yeszao/dnmp
相关文章
- Axure RP 8中文版(交互式原型设计工具) axure rp8v8.1.0.3400
- 浏览器滚动条的自定义和隐藏
- tep支持pytest-xdist分布式执行用例及合并Allure报告
- Java编程中忽略这些细节,Bug肯定找上你
- 9个问题,带你掌握流程控制语句中的java原理
- 从IDC Marketscape报告看区块链政务数字化未来:权威解读新热点、新机遇
- chatGPT的火爆,并不偶然
- React 开发 | 常用 Hooks
- JDK19都出来了~是时候梳理清楚JDK的各个版本的特性了【JDK12特性讲解】
- Eolink 让我“重新认识“了自动化测试...
- 老板:你也把咱们网站弄成灰色——网站变灰色如何实现
- iptables规则案例
- ‘极锐’-一种新的锐化算法
- PS/LR滤镜插件套装 Nik Collection v5.3.0 Win/Mac
- Chrome插件:uBlock Origin – Chrome浏览器高效低占用的广告拦截插件
- 前端与区块链
- 云原生之微服务
- 集群动态环境管理神器 Modules
- 记 os_object_release Crash 排查
- 记 libAccessibility 通知 Crash 排查