User Tools

Site Tools


wiki:verdaccio_installation

Differences

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

Link to this comparison view

Next revision
Previous revision
wiki:verdaccio_installation [2021/07/01 15:03] – created 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 19: Line 22:
 auth: auth:
   htpasswd:   htpasswd:
-    file: ./htpasswd+    file: /verdaccio/conf/htpasswd
 uplinks: uplinks:
   npmjs:   npmjs:
Line 41: Line 44:
 </code> </code>
  
-===== Pull from docker =====+
 <code docker> <code docker>
 docker run -it --detach \ docker run -it --detach \
Line 52: Line 55:
 </code> </code>
  
 +We are using docker bind mount so we need to change the permissions
 +
 +   chown -R 10001:65533 /root/verdaccio/
 +
 +
 +
 +==== Using Docker volume (recommended) ====
 +[[https://docs.docker.com/storage/volumes/|Docker volume]] is the recommended method.
 +
 +Create volumes:
 +  docker volume create verdaccio
 +  docker volume create verdaccio-storage
 +
 +Run with volume:
 +<code docker>
 +docker run -it --detach \
 +    --publish 4873:4873 \
 +    --mount source=verdaccio,target=/verdaccio \
 +    --mount source=verdaccio-storage,target=/verdaccio/storage \
 +    --name verdaccio \
 +    verdaccio/verdaccio
 +</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 59: 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 116: 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
   * https://verdaccio.org/docs/en/authentication   * https://verdaccio.org/docs/en/authentication
 +  * https://verdaccio.org/docs/en/docker
  
wiki/verdaccio_installation.1625144634.txt.gz · Last modified: 2021/07/01 15:03 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