将blog打包镜像

This commit is contained in:
estom
2025-07-12 06:00:49 -04:00
parent b1e929108f
commit ee4ad3488c
11 changed files with 246 additions and 2 deletions

31
MyScript/blog/run_blog.sh Normal file
View File

@@ -0,0 +1,31 @@
nohup docsify serve -p 80 /root/gitee/notes &> blog.log &
# 使用容器的方式打包当前镜像
docker build -t my-docsify-blog .
# 运行容器
docker run -d --restart=always \
--name docsify-blog \
-p 3000:3000 \
-v $(pwd):/docs \
my-docsify-blog
docker run --name docsify-blog \
-p 3000:3000 \
my-docsify-blog
# 查看日志
docker logs -f docsify-blog
# 停止 / 启动
docker stop docsify-blog
docker start docsify-blog
# 更新镜像后重新部署
docker build -t my-docsify-blog .
docker rm -f docsify-blog
docker run -d ... # 同上