docker-compose部署Maven私服Nexus3

 maven是一个采用纯Java编写的开源工具

采用一种被称为project object Mode(POM)概念来管理项目,所有的项目配置信息都被定义在一个叫POM.xml的文件中,公告该文件Maven可以管理项目的整个生命周期,包括清除、测试、报告、打包、部署等等
maven和ant都是软件构建工具(软件管理工具),maven比ant更强大,已经取代了ant.jar宝的声明式依赖描述,maven有jar包仓库
私服是架设在局域网的一种特殊的远程仓库,目的是代理远程仓库及部署第三方构建,有了私服之后,

当maven需要下载构建是,直接请求私服,私服上存在则下载到本地仓库,否则私服请求外部的远程仓,将构建下载到私服,再提供给本地仓库下载

mkdir -p /data/nexus/data/ && chown -R 200 /data/nexus/data/
cat docker-compose.yml
version: '3'

services: nexus: image: sonatype
/nexus3:latest container_name: nexus restart: always ports: - 8081:8081 volumes: - /data/nexus/data:/nexus-data - /etc/localtime:/etc/localtime
logging:
driver: "json-file"
options:
max-size: "200"
max-file: "10" # 非80端口转发 nginx conf server { listen
80; server_name nexus.abc.com; access_log nexus.abc.com.access.log main; # return 301 https://nexus.abc.com$request_uri; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 300M; # 设置单次上传最大为300m proxy_pass http://127.0.0.1:8081; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name nexus.abc.com; access_log nexus.abc.com.access.log main; # SSL ssl_certificate /etc/letsencrypt/live/nexus.abc.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/nexus.abc.com/privkey.pem; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; # 转发时使用https协议nexus的ssl必须要设置这个 client_max_body_size 300M; # 设置单次上传最大为300m proxy_pass http://127.0.0.1:8081; } }

 

首次登录密码在/data/nexus/data//admin.password 

 

posted @ 2022-01-02 15:06  缺个好听的昵称  阅读(109)  评论(0)    收藏  举报