项目简介
Jpom是一个简而轻的低侵入式在线构建、自动部署、日常运维、项目运维监控软件。
安装环境
工具 | 版本 |
---|---|
系统 | CentOS 7 |
Docker | 25.0.4 |
Docker-Compose | 2.24.7 |
Jpom | 1.22.1 |
安装步骤
安装Docker
具体安装步骤见:Docker安装教程
安装docker-compose
具体安装步骤见:Docker-Compose安装教程
安装Jpom
新建目录
mkdir -p /你的路径/jpom/data /你的路径/jpom/logs /你的路径/jpom/conf
编写docker-compose.yml文件
在jpom目录下新建docker-compose.yml文件,并填写以下内容
version: '3.8'
services:
server:
image: jpomdocker/jpom:2.11.8
container_name: jpom
restart: always
volumes:
- $PWD/data:/usr/local/jpom-server/data
- $PWD/logs:/usr/local/jpom-server/logs
- $PWD/conf:/usr/local/jpom-server/conf
- /etc/localtime:/etc/localtime:ro
- /usr/bin/docker:/usr/bin/docker
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "2122:2122"
启动容器
在docker-compose.yml文件所在目录下执行
docker-compose up -d
实时查看日志:
docker-compose logs -f
至此Jpom就安装好了。
反向代理(非必须)
我们这里使用Nginx
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name xxx.xxx.com;
charset utf-8;
access_log off;
ssl_certificate /home/cert/fullchain.cer;
ssl_certificate_key /home/cert/xxx.com.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://localhost:2122;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# iframe 重定向
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
client_max_body_size 50000m;
client_body_buffer_size 128k;
# websocket 配置
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
listen 80;
listen [::]:80;
server_name xxx.xxx.com;
# 核心代码
rewrite ^(.*)$ https://${server_name}$1 permanent;
}
评论区