docker应用练习
2023-06-13 09:16:17 时间
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
相关文章
- docker容器概念介绍和简单的应用
- n1.Docker容器安装运行所遇异常解决
- 3-Docker应用部署
- Docker 快速部署 Slurm 集群
- 用docker部署jar包_docker run 参数
- [接上篇]在Window10/11的Linux子系统Docker上部署VB.NET Asp.Net Core WebAPI应用
- 【Docker】基于Rancher快速部署docker容器管理平台
- 【已解决】Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon runnin
- 2022-12-23:portainer是docker的web可视化工具。如果根据docker部署去写yaml,默认local是k8s,而不是docker,这不
- 「 【Docker】设置docker加速器(如何使docker下载速度变快) 」
- 「 【Docker】如何处理宝塔docker管理器未启动 」
- 【Docker 系列】docker 学习六,探究一下数据卷容器
- mysql主从复制(基于docker容器化)
- Docker安装Kafka(docker-compose)、EFAK监控
- 【Docker】初识Dcoker以及镜像操作(一)
- docker部署
- docker 常用命令
- docker-compose 安装部署 mysql
- 浅析 Docker overlay2 文件结构
- 使用Docker部署Redis服务(dockerredis)
- 服务基于 Docker 的 Redis 服务部署方案(dockerredis)
- docker从Abp到MySQL,使用Docker快速部署(abpmysql)
- Docker搭建Redis及其配置使用(dockerredis)
- docker-Docker Registry私有仓库
- 基于Docker开发NodeJS应用