github:https://github.com/jamebal/jmal-cloud-view
拉取镜像
选个离你近的即可, 这里以广州为例
杭州: docker pull registry.cn-hangzhou.aliyuncs.com/jmalcloud/jmalcloud:latest
广州: docker pull registry.cn-guangzhou.aliyuncs.com/jmalcloud/jmalcloud:latest
成都: docker pull registry.cn-chengdu.aliyuncs.com/jmalcloud/jmalcloud:latest
北京: docker pull registry.cn-beijing.aliyuncs.com/jmalcloud/jmalcloud:latest
运行
docker run --restart=always --name jmalcloud -p 7070:80 -p 7071:8080 -p 7072:8088 -v /Users/jmal/temp/jmalcloud-docker/files/:/jmalcloud/files/ -v /Users/jmal/temp/jmalcloud-docker/db/:/data/db/ -d registry.cn-guangzhou.aliyuncs.com/jmalcloud/jmalcloud:latest
启动参数说明 :
暴露端口 :
`80` : 网盘入口
`8080` : 博客入口
`8088` : 网盘服务入口
磁盘映射 :
`/jmalcloud/files/` : 网盘文件存储目录
`/data/db/` : mongodb数据存储目录
访问试试看
启动后等待40秒左右,访问7070端口看到如下界面,说明部署成功
nginx 配置
nginx
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:7070;
proxy_set_header Host $proxy_host;
#下边是为获取真实IP所做的设置
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect default;
}
location /mq {
proxy_pass http://localhost:7070/mq/;
#websocket额外配置开始
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_connect_timeout 60s;#l连接超时时间,不能设置太长会浪费连接资源
proxy_read_timeout 500s;#读超时时间
proxy_send_timeout 500s;#写超时时间
#websocket额外配置结束
}
}