1、maven私服-------nexus
使用docker部署,下载最新的image
#docker pull sonatype/nexus3
#cat docker-compose.yml
version: '2'
services:
nexus:
image: sonatype/nexus3
container_name: nexus3
networks:
- nexus3
ports:
- 8081:8081
volumes:
- /data/nexus:/nexus/data
networks:
nexus3:
driver: bridge
#mkdir /data/nexus
#docker-compose up -d
安装好之后默认的用户名/密码是admin/admin123,需要自己修改密码,访问
http://ip:port
默认的maven-central 使用的是https://repo1.maven.org/maven2/ 地址,速度上没有UK 的快,所以修改为http://uk.maven.org/maven2/。
2、nginx代理
server {
listen 80;
client_max_body_size 204800m;
client_body_timeout 300000000s;
send_timeout 3000000000s;
server_name www.nexus.com;
location / {
proxy_pass http://10.1.1.12:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}