jaslo / npm-registry

Docker image for running npm registry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contents

Introduction

Dockerfile to build image with npm registry proxied with kappa.

Version

Current Version: 2.6.6

Installation

Pull the latest or specific version of the image from the docker index. This is the recommended method of installation as it is easier to update image in the future. These builds are performed by the Docker Trusted Build service.

docker pull burkostya/npm-registry:2.6.6

Alternately you can build the image yourself.

git clone https://github.com/burkostya/npm-registry.git
cd npm-registry
docker build -t '<user>/npm-registry' .

Quick Start

Run container

docker run --name='npm-registry' -i -t --rm \
  -p 5984:5984 -p 80:80 \
  burkostya/npm-registry:2.6.6

Couchdb with installed couchapp now available on http://localhost:5984.

Credentials:

  • username: admin
  • password: password

You can set your login and password for couchdb admin:

docker run --name='npm-registry' -i -t --rm \
  -e 'COUCHDB_ADMIN_LOGIN=<login>' \
  -e 'COUCHDB_ADMIN_PASSWORD=<password>' \
  -p 5984:5984 -p 80:80 \
  burkostya/npm-registry:2.6.6

Kappa is exposed on port 80. You can use it by setting option in .npmrc:

npm config set registry http://localhost

or adding option to every command:

npm --registry http://localhost

Configuration

Data Store

For data persistency you should mount a volume

/var/lib/couchdb

Volumes can be mounted in docker by specifying the '-v' option in the docker run command.

mkdir /opt/data/npm-registry
docker run --name='npm-registry' -d \
  -p 5984:5984 -p 80:80 \
  -v /opt/data/npm-registry:/var/lib/couchdb \
  burkostya/npm-registry:2.6.6

Upgrading

To upgrade to newer couchapp, follow this steps:

  • Update the docker image.
docker pull burkostya/npm-registry:2.6.6
  • Stop the currently running image
docker stop npm-registry
docker rm npm-registry
  • Backup the application data just by coping content of mounted volume
cp -r /opt/data/npm-registry /some/npm/backup/dir/
  • Start the image
docker run --name npm-registry -d \
  -e 'COUCHDB_ADMIN_LOGIN=<login>' \
  -e 'COUCHDB_ADMIN_PASSWORD=<password>' \
  -p 5984:5984 -p 80:80 \
  -v /opt/data/npm-registry:/var/lib/couchdb \
  burkostya/npm-registry:2.6.6

Thanks

  • @sameersbn for awesome template of container configuration

About

Docker image for running npm registry

License:MIT License


Languages

Language:Shell 100.0%