前言
pms作为项目管理系统,为我们项目的开发带来了极大的便利性
docker方式部署
cat > docker-run-pms.sh <<-EOF
docker run -d \
-p 8085:80 \
-p 3385:3306 \
-p 2285:22 \
-e ADMINER_USER="root" \
-e ADMINER_PASSWD="password" \
-e BIND_ADDRESS="false" \
-v /mnt/pms/:/opt/zbox/ \
--add-host smtp.exmail.qq.com:xxx.xxx.xxx.xxx \
--restart=always \
--name pms \
idoop/zentao:latest
EOF
bash docker-run-pms.sh
nginx配置pms域名80端口
- 注: 此处仅以文件配置为例,其它nginx部署安装及域名解析等不再赘述
cat > /etc/nginx/conf.d/pms.conf <<-EOF
upstream pms{
server 127.0.0.1:8085;
}
server {
listen 80;
server_name pms.xxx.xxx;
rewrite ^/(.*)$ https://pms.xxx.xxx/$1 permanent;
}
server {
listen 443;
server_name pms.xxx.xxx;
ssl on;
ssl_certificate cert_auth/pms.xxx.xxx.pem;
ssl_certificate_key cert_auth/pms.xxx.xxx.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
#access_log /var/log/nginx/pms/access.log;
#error_log /var/log/nginx/pms/error.log;
location / {
proxy_pass http://pms;
client_max_body_size 1024M;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
EOF
docker-compose部署pms
cat docker-compose.yml
version: "3.5"
services:
pms:
image: idoop/zentao:latest
container_name: pms
hostname: pms
privileged: true
user: root
ports:
- 80:80
- 3385:3306
environment:
- ADMINER_USER=root
- ADMINER_PASSWD=xxx
- BIND_ADDRESS=false
- SET_CONTAINER_TIMEZONE=true
- CONTAINER_TIMEZONE=Asia/Shanghai
volumes:
- /etc/localtime:/etc/localtime:ro
- /data/pms/:/opt/zbox/
restart: always
extra_hosts:
- "smtp.exmail.qq.com:xxx.xxx.xxx.xxx"
tty: true