Docker自学文档
学前零星使用操作
一、基础镜像篇
二、基础容器篇
三、容器数据卷
四、DockerFile构建镜像
五、网络篇
六、Docker Compose
docker 在已经启动的容器中开启端口映射
ubuntu22.04使用docker-compose部署最美博客系统
本文档使用 MrDoc 发布
-
+
home page
ubuntu22.04使用docker-compose部署最美博客系统
### 系统环境 `系统版本:` ``` root@fh:~# hostnamectl Static hostname: fh Icon name: computer-vm Chassis: vm Machine ID: 01fe7d2016ea400a8a87f2460668450c Boot ID: 7b0dd720a76140b3a13b666014da61b1 Virtualization: vmware Operating System: Ubuntu 22.04.4 LTS Kernel: Linux 6.5.0-28-generic Architecture: x86-64 Hardware Vendor: VMware, Inc. Hardware Model: VMware Virtual Platform ``` `docker版本、docker-compose版本:` ``` root@fh:~# docker -v Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1 root@fh:~# docker-compose -v Docker Compose version v2.20.3 ``` `docker、docker-compose安装参考本文献前面的内容` ### 开始安装 **创建系统目录** ``` root@fh:~# mkdir /data ``` **上传源码到当前目录下** ``` root@fh:~# ls poetize-docker-compose.zip ``` **解压** ``` root@fh:~# unzip poetize-docker-compose.zip root@fh:~# ls data poetize-docker-compose.zip ``` **将代码mv到/data目录下** ``` root@fh:~# mv data/public/ /data/ ``` **进入到博客系统目录** ``` root@fh:~# cd /data/public/ root@fh:/data/public# ls code depoly.sh docker file mysql nginx nginxForHttp.conf nginxForHttps.conf poetize poetize-im-ui poetize-ui poetry.sql ssl ``` **进入到docker目录中** ``` root@fh:/data/public/docker# ls docker-compose.yml Dockerfile ``` **检查语法并安装** ``` root@fh:/data/public/docker# docker-compose config -q root@fh:/data/public/docker# docker-compose up -d [+] Running 1/1 ✔ mysql Pulled 10.6s [+] Building 1.1s (5/5) FINISHED docker:default => [poetize-server internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [poetize-server internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 351B 0.0s => [poetize-server internal] load metadata for docker.io/library/openjdk:8-jre-alpine 1.1s => CACHED [poetize-server 1/1] FROM docker.io/library/openjdk:8-jre-alpine@sha256:f362b165b870ef129cbe730f29065ff37399c0aa8bcab3e44b51c302938c9193 0.0s => => resolve docker.io/library/openjdk:8-jre-alpine@sha256:f362b165b870ef129cbe730f29065ff37399c0aa8bcab3e44b51c302938c9193 0.0s => [poetize-server] exporting to image 0.0s => => exporting layers 0.0s => => writing image sha256:dbb46e777c43e9ffc0deaa4a0e3a7091d06710534611ff01cf3912db0d8ef861 0.0s => => naming to docker.io/library/docker-poetize-server 0.0s [+] Running 3/3 ✔ Container pz-mysql Started 0.1s ✔ Container pz-nginx Started 0.0s ✔ Container poetize-server Started ``` **使用数据库连接软件导入数据库** ![](/media/202404/2024-04-26_105506_5812060.5384883403665351.png) ![](/media/202404/2024-04-26_105638_2743050.879059438277059.png) ![](/media/202404/2024-04-26_105654_9694490.4873767164484972.png) **重启poetize-server容器** ``` root@fh:/data/public/docker# docker restart poetize-server poetize-server ``` **检查容器日志** ``` root@fh:/data/public/docker# docker logs poetize-server ``` 出现如下即为正常 ![](/media/202404/2024-04-26_105821_2037160.6355481900835972.png) **测试访问** ![](/media/202404/2024-04-26_105857_6230070.6841313140012549.png) ### 其它说明 `博客项目地址:`https://gitee.com/littledokey/poetize `博客网址:`https://poetize.cn/ ### 源码包群里私信。
admin
April 26, 2024, 11:24 a.m.
转发文档
Collection documents
Last
Next
手机扫码
Copy link
手机扫一扫转发分享
Copy link
IT集中营导航
IT集中营导航
Markdown文件
share
link
type
password
Update password