Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

docker compose 部署

version: '3.8'

services:
  nexus:
    image: sonatype/nexus3:latest
    container_name: nexus3
    restart: always
    ports:
      - "8081:8081"  # Nexus 管理界面
      - "8082:8082"  # npm 私有仓库端口(可选,也可使用上下文路径)
      - "8083:8083"  # Maven 私有仓库端口(可选)
    volumes:
      - ./nexus-data:/nexus-data  # 持久化数据卷
    environment:
      - INSTALL4J_ADD_VM_PARAMS=-Xms512m -Xmx2g  # 调整内存配置
    networks:
      - nexus-network

volumes:
  nexus-data:  # 自动创建数据卷,数据持久化

networks:
  nexus-network:
    driver: bridge

初次访问 http://localhost:8081,获取密码

docker exec nexus3 cat /nexus-data/admin.password

登录

admin + 👆🏻 密码