User Tools

Site Tools


wiki:verdaccio_installation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:verdaccio_installation [2021/07/22 14:56] – add Docker volume is the recommended method. antisawiki:verdaccio_installation [2021/07/23 15:27] (current) – [Apache reverse proxy config] antisa
Line 4: Line 4:
 Create a private npm registry (repository). Create a private npm registry (repository).
  
-===== Create folder structure and conf file =====+===== Pull from docker ===== 
 +==== Bind mount method (for testing) ==== 
 + 
 +Create folder structure and conf file
   mkdir verdaccio && cd verdaccio   mkdir verdaccio && cd verdaccio
   mkdir conf   mkdir conf
Line 39: Line 42:
 logs: logs:
   - {type: stdout, format: pretty, level: http}   - {type: stdout, format: pretty, level: http}
 +</code>
 +
 +
 +<code docker>
 +docker run -it --detach \
 +    --publish 4873:4873 \
 +    --volume `pwd`/conf:/verdaccio/conf \
 +    --volume `pwd`/storage:/verdaccio/storage \
 +    --volume `pwd`/plugins:/verdaccio/plugins \
 +    --name verdaccio \
 +    verdaccio/verdaccio
 </code> </code>
  
Line 45: Line 59:
    chown -R 10001:65533 /root/verdaccio/    chown -R 10001:65533 /root/verdaccio/
  
 +
 +
 +==== Using Docker volume (recommended) ====
 [[https://docs.docker.com/storage/volumes/|Docker volume]] is the recommended method. [[https://docs.docker.com/storage/volumes/|Docker volume]] is the recommended method.
  
-===== Pull from docker =====+Create volumes: 
 +  docker volume create verdaccio 
 +  docker volume create verdaccio-storage 
 + 
 +Run with volume:
 <code docker> <code docker>
 docker run -it --detach \ docker run -it --detach \
     --publish 4873:4873 \     --publish 4873:4873 \
-    --volume `pwd`/conf:/verdaccio/conf +    --mount source=verdaccio,target=/verdaccio \ 
-    --volume `pwd`/storage:/verdaccio/storage +    --mount source=verdaccio-storage,target=/verdaccio/storage \
-    --volume `pwd`/plugins:/verdaccio/plugins \+
     --name verdaccio \     --name verdaccio \
     verdaccio/verdaccio     verdaccio/verdaccio
 </code> </code>
  
 +Set correct path to htpasswd file in ///var/lib/docker/volumes/verdaccio/_data/conf/config.yml//
 +<code yml>
 +...
 +auth:
 +  htpasswd:
 +    file: /verdaccio/conf/htpasswd
 +...
 +</code>
 ===== Create user ===== ===== Create user =====
  
Line 65: Line 93:
  
 ===== Apache reverse proxy config ===== ===== Apache reverse proxy config =====
 +Enable required apache modules:
 +
 +  a2enmod proxy proxy_http proxy_balancer ssl rewrite
  
 <code apache> <code apache>
Line 122: Line 153:
  
 ====== See also ====== ====== See also ======
 +  * [[wiki:verdaccio_vanilla_install|Verdaccio vanilla install]]
 ====== References ====== ====== References ======
   * https://blog.bitsrc.io/how-to-set-up-a-private-npm-registry-locally-1065e6790796   * https://blog.bitsrc.io/how-to-set-up-a-private-npm-registry-locally-1065e6790796
wiki/verdaccio_installation.1626958599.txt.gz · Last modified: 2021/07/22 14:56 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki