Nexus3部署
//
# 使用docker-compose 部署nexus3
docker-hub镜像地址 (opens new window)
cd /data/ && vi docker-compose-nexus.yml
version: '3'
services:
nexus3:
container_name: nexus3
restart: always
image: sonatype/nexus3:3.60.0
volumes:
- /etc/localtime:/etc/localtime
- ./nexus3:/nexus-data
network_mode: "host"
environment:
- INSTALL4J_ADD_VM_PARAMS=-Xms4g -Xmx4g -XX:MaxDirectMemorySize=4g -Djava.util.prefs.userRoot=/nexus-data/javaprefs
#docker run -dti --net=host --name=nexus3 --privileged=true --restart=always -e INSTALL4J_ADD_VM_PARAMS="-Xms4g -Xmx4g -XX:MaxDirectMemorySize=6g" -v /etc/localtime:/etc/localtime -v /application/nexus3:/nexus-data sonatype/nexus3:3.29.2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
启动
docker-compose -f docker-compose-nexus.yml up -d
- 配置nginx ,域名解析访问
vi /etc/nginx/sites-enabled/nexus3.conf
upstream nexus_web {
server 127.0.0.1:8081;
}
# nexus3 web 管理
server {
listen 80;
# listen 443 ssl;
server_name mirror.yfklife.cn;
client_max_body_size 0;
proxy_max_temp_file_size 0;
client_body_buffer_size 4096m;
# ssl_certificate /data/wwwroot/ssl/mirror.yfklife.cn.crt;
# ssl_certificate_key /data/wwwroot/ssl/mirror.yfklife.cn.key.pem;
# ssl_protocols TLSv1.1 TLSv1.2;
# ssl_ciphers '!aNULL:kECDH+AESGCM:ECDH+AESGCM:RSA+AESGCM:kECDH+AES:ECDH+AES:RSA+AES:';
# ssl_prefer_server_ciphers on;
# ssl_session_cache shared:SSL:10m;
location /download {
alias /application/download;
}
location / {
proxy_pass http://nexus_web;
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 $scheme;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
按照提示创建,修改密码
//
如果此文章对您有帮助,点击 -->> 请博主喝咖啡 (opens new window)
上次更新: 2024/06/18, 14:42:35