一、使用docker方式部署

二、源码部署(Linux/Mac)

1.下载相关软件包到服务器

这里下载最新版的前端和后端程序, 再下载ip2region.db

# 1.下载后端程序
wget https://github.com/jamebal/jmal-cloud-server/releases/download/v2.3.3/clouddisk-2.3.3-exec.jar
# 2.下载前端程序
wget https://github.com/jamebal/jmal-cloud-server/releases/download/v2.3.3/dist-2.3.3.tar
# 3.下载ip2region.db
wget https://github.com/jamebal/jmal-cloud-server/raw/master/docker/ip2region.db
# 解压前端程序包
tar -xzf dist-2.3.3.tar

2. 启动后端服务

nohup java --enable-preview -Xms50m -Xmx1024m -jar clouddisk-$version-exec.jar --logging.level.root=info --spring.profiles.active=prod --spring.data.mongodb.uri='这里填MONGODB_URI' --file.rootDir='你自己的文件存储目录' --file.ip2region-db-path='ip2region.db文件位置' > jmalcloud.log 2>&1 &

3. (非必须)启动onlyoffice(文档预览)和 drawio(流程图编辑)

onlyoffice和drawio将使用docker部署

onlyoffice docker-compose.yml

version: '3'

services:
  office:
    container_name: "onlyoffice"
    image: "onlyoffice/documentserver:7.0.0.132"
    environment:
      TZ: "Asia/Shanghai"
    ports:
      - 3454:80
    restart: always

drawio docker-compose.yml

version: '3'

services:
  drawio-webapp:
    container_name: "drawio"
    image: "registry.cn-guangzhou.aliyuncs.com/jmalcloud/jgraph_drawio:16.6.1"
    environment:
      TZ: "Asia/Shanghai"
    ports:
      - 9910:8080
    restart: always

4.nginx配置参考

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}
map $http_host $this_host {
    "" $host;
    default $http_host;
}
map $http_x_forwarded_proto $the_scheme {
     default $http_x_forwarded_proto;
     "" $scheme;
}
map $http_x_forwarded_host $the_host {
    default $http_x_forwarded_host;
    "" $this_host;
}

server
{
    listen 80;
    server_name jmal.top;
    #rewrite ^(.*) https://www.jmal.top$1 permanent;
  
    location /webDAV/ {
                proxy_pass   http://localhost:8088/;
                proxy_http_version 1.1;
                proxy_set_header X-real-ip $remote_addr;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_redirect $host/ $http_host/;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
    }  
  
}
###jmalcloud 前端配置
server {
        listen 443 ssl;
        # 这里为前端程序解压后的目录路径
        root /root/jmalcloud/dist;
        server_name  www.jmal.top;
        ssl_certificate   /www/server/nginx/cert/7645914_www.jmal.top.pem;
        ssl_certificate_key  /www/server/nginx/cert/7645914_www.jmal.top.key;        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        location /api/ {
                proxy_pass   http://localhost:8088/;
                proxy_http_version 1.1;
                proxy_set_header X-real-ip $remote_addr;
                proxy_set_header X-Real-IP $remote_addr;
        }
  
        location /api/webDAV/ {
                proxy_pass   http://localhost:8088/webDAV/;
                proxy_http_version 1.1;
                proxy_set_header X-real-ip $remote_addr;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_redirect $host/ $http_host/;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
        }
  
        location / {
                try_files $uri $uri/ /index.html;
                index index.html index.htm;
        }
  
        location /mq {
                proxy_pass   http://localhost:8088/mq/;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
		proxy_connect_timeout 60s;
	        proxy_read_timeout 500s;
	        proxy_send_timeout 500s;
        }
  
            # only-office服务
            location /office/ {
                proxy_pass http://localhost:3454/;
                proxy_http_version 1.1;
                proxy_set_header X-real-ip $remote_addr;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Real-PORT $remote_port;
                proxy_set_header X-Forwarded-Host $the_host/office;
                proxy_set_header X-Forwarded-Proto $the_scheme;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header Scheme $scheme;
                proxy_set_header Server-Protocol $server_protocol;
                proxy_set_header Server-Name $server_name;
                proxy_set_header Server-Addr $server_addr;
                proxy_set_header Server-Port $server_port;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
            }
  
            # drawio服务
            location /drawio/webapp/ {
                           proxy_pass http://localhost:9910/;
                           proxy_http_version 1.1;
                           proxy_set_header X-Real-IP $remote_addr;
                           proxy_set_header X-Real-PORT $remote_port;
                           proxy_set_header X-Forwarded-Host $the_host/drawio/webapp;
                           proxy_set_header X-Forwarded-Proto $the_scheme;
                           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                           proxy_set_header Host $http_host;
                           proxy_set_header Scheme $scheme;
                           proxy_set_header Server-Protocol $server_protocol;
                           proxy_set_header Server-Name $server_name;
                           proxy_set_header Server-Addr $server_addr;
                           proxy_set_header Server-Port $server_port;
                           proxy_set_header Upgrade $http_upgrade;
                           proxy_set_header Connection $connection_upgrade;
                       }

        # location ~ \.(eot|otf|ttf|woff|woff2|svg)$ {        }
}