https://github.com/nemanjam/verdaccio-docker
https://github.com/nemanjam/verdaccio-docker
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nemanjam/verdaccio-docker
- Owner: nemanjam
- License: mit
- Created: 2025-01-17T21:08:44.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-01-26T19:05:08.000Z (12 months ago)
- Last Synced: 2025-01-26T20:19:08.401Z (12 months ago)
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Verdaccio Docker
## Installation
```bash
# set Docker user for storage folder
# ~/.bashrc
export MY_UID=$(id -u)
export MY_GID=$(id -g)
# run, go to http://localhost:4873/
docker compose up -d
```
## Create local user
```bash
# create user (user from config.yml fails currently)
npm adduser --registry http://localhost:4873
# user: admin, pass: 123456, email: admin@example.com
# login in ui
```
## Publish package locally
```bash
# from the package
npm publish --registry http://localhost:4873
```
## Install local package
### Scope level
```bash
# set project-level .npmrc
# ~/Desktop/my-project/.npmrc
@my-org:registry=http://localhost:4873
# Note: you must have entire dependency tree for @my-org scope in local Verdaccio
# with specified versions, "@my-org/my-package": "workspace:*", will fail
# Solution: easiest, go to my-package/node_modules/@my-org and publish all dependencies from there
npm publish --registry http://localhost:4873
```
### Single package level
```bash
npm install my-package --registry=http://localhost:4873
# Todo: this will fail, install with 2 registries error
```
## Unpublish package
```bash
# all versions
npm unpublish my-package --registry http://localhost:4873 --force
# specific version
npm unpublish my-package@1.2.3 --registry http://localhost:4873 --force
```
## Todo:
- Set user/password/email in `config.yaml`
- Resolve just a single package from Verdaccio (including its dependencies)
## References
- Only the basics with Docker https://medium.com/havelsan/how-to-publish-custom-npm-packages-to-a-private-local-registry-using-verdaccio-on-docker-0494fb5938ab