NPM 私服
verdaccio 私服搭建,搭建过程中的一些问题以及解决:
docker compose启动后,可能会报错:配置找不到,添加config.yaml文件到映射的./conf目录即可,config.yaml具体内容可在官网找到,下方也有最小化配置。
services:
  verdaccio:
    image: verdaccio/verdaccio
    container_name: 'verdaccio'
    networks:
      - node-network
    environment:
      - VERDACCIO_PORT=4873
      - VERDACCIO_PUBLIC_URL=http://npm.demo.com
    ports:
      - '10001:4873'
    volumes:
      - './storage:/verdaccio/storage'
      - './plugins:/verdaccio/plugins'
      - './conf:/verdaccio/conf'
networks:
  node-network:
    driver: bridgedocker-compose.yaml
# path /path/to/verdaccio-docker/conf/config.yaml
storage: ./storage
plugins: ./plugins
web:
  title: NPM
  primary_color: '#1b7e76'
  favicon: http://npm.demo.com/favicon.ico
  logo: http://npm.demo.com/logo.png
  showFooter: false
  publicPath: http://npm.demo.com/
auth:
  htpasswd:
    file: ./htpasswd
    # max_users: 1000
uplinks:
  npmjs:
    url: https://registry.npmjs.org/
packages:
  '@*/*':
    access: $all
    publish: $authenticated
    unpublish: $authenticated
    proxy: npmjs
  '**':
    access: $all
    publish: $authenticated
    unpublish: $authenticated
    proxy: npmjs
server:
  keepAliveTimeout: 60
publish:
  allow_offline: false
middlewares:
  audit:
    enabled: true
i18n:
  web: zh-CN
config.yaml