ICE4 Install Nexus3 on docker

Install docker

 

Install docker-compose

https://docs.docker.com/compose/install/

 

Make directory

/app/nexus3

 

Mkdir docker-compose-nexus.yml

version: '3.7'

services:
nexus3:
image: sonatype/nexus3:3.29.2
container_name: nexus3
restart: always
ports:
- 8081:8081
volumes:
- /app/nexus:/nexus-data

 

Run command

docker-compose -f docker-compose-nexus.yml up -d

 

Create nginx config file like nexus.conf on /etc/nginx/conf.d

server {

listen 80;

listen 443;

server_name  neuxs.justten.io;

charset utf-8;

rewrite_log on;

client_max_body_size 50M;

location / {

proxy_pass http://127.0.0.1:8081;

proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection 'upgrade';

proxy_set_header Host $host;

proxy_cache_bypass $http_upgrade;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-Proto http;

proxy_set_header X-Forwarded-Host $host;

proxy_set_header X-Forwarded-Server $host;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


proxy_connect_timeout 300;

proxy_send_timeout 300;

proxy_read_timeout 300;

send_timeout 300;

}


if ($http_x_forwarded_proto = "http") {

return    301 <https://$server_name$request_uri;>

}

}

 

Check nexus3

docker ps

 

 


Accessing the nexus3 Docker container

docker container exec -it nexus3 bash

Accessing the nexus3 console log through Docker logs

docker container logs nexus -f