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

posted @ 2021-06-24 14:38  落叶&不随风  阅读(242)  评论(0编辑  收藏  举报