1. 挂载目录配置

1
2
3
4
5
6
7
.\npm-registry
├─docker-compose.yaml
├─verdaccio
| ├─storage
| ├─plugins
| ├─conf
| | ├─config.yaml

2. config.yaml 配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 配置

1
2
3
4
5
6
7
8
9
10
11
12
13
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