NPM 私有仓库搭建
1. 挂载目录配置
.\npm-registry
├─docker-compose.yaml
├─verdaccio
| ├─storage
| ├─plugins
| ├─conf
| | ├─config.yaml
2. config.yaml 配置
storage: /verdaccio/storage
plugins: /verdaccio/plugins
web:
title: Verdaccio
auth:
htpasswd:
file: ./htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@*/*':
access: $all
publish: $authenticated
unpublish: $authenticated
proxy: npmjs
'**':
access: $all
publish: $authenticated
unpublish: $authenticated
proxy: npmjs
middlewares:
audit:
enabled: true
logs:
- {type: stdout, format: pretty, level: http}
3. docker-compose.yaml 配置
version: '3.6'
services:
npm-registry:
image: verdaccio/verdaccio
ports:
- 4873:4873
restart: always
volumes:
- ./verdaccio/conf:/verdaccio/conf
- ./verdaccio/storage:/verdaccio/storage
- ./verdaccio/plugins:/verdaccio/plugins
volumes:
db_data:
NOTE
-
npm register url => http://localhost:4873
-
进入首页后,按照提示 添加用户 -> 登录 ->发布
-
仓库选用 verdaccio/verdaccio 镜像搭建,官方文档: https://verdaccio.org/fr-FR/
原博客链接:https://www.cnblogs.com/xpengp/