Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

🚢 CouchDB Docker image running npm-registry-couchapp

License

Notifications You must be signed in to change notification settings

semantic-release/npm-registry-docker

Repository files navigation

semanticrelease/npm-registry-docker

CouchDB Docker image running npm-registry-couchapp.

Build Status

This docker image is for test and development purposes only.

Install

$ docker pull semanticrelease/npm-registry-docker:latest

Usage

With default environment variables

$ docker run -d -p 5984:5984 semanticrelease/npm-registry-docker

The npm registry is accessible on http://localhost:5984/registry/_design/app/_rewrite and the CouchDB user admin with password admin is created.

To configure npm to use the registry:

$ npm config set registry http://localhost:5984/registry/_design/app/_rewrite

To create a npm user and configure npm authentication:

$ curl -H 'Content-Type: application/json' -XPUT -d '{"_id": "org.couchdb.user:npm-user","name": "npm-user","roles": [],"type": "user","password": "npm-password","email":  "[email protected]"}' "http://admin:admin@localhost:5984/_users/org.couchdb.user:npm-user"

$ echo "_auth = $(echo -n npm-user:npm-password | base64)" >> .npmrc
$ echo "email = [email protected]" >> .npmrc

With custom admin user and vhost configuration

$ docker run -d -p 5984:5984 -e COUCHDB_USER=my-user -e COUCHDB_PASSWORD=my-password -e VHOST=my-registry.com semanticrelease/npm-registry-docker

The npm registry is accessible on http://my-registry:5984 and the CouchDB user my-user with password my-password is created.

To configure npm to use the registry:

$ npm config set registry http://my-registry:5984

To create a npm user and configure npm authentication:

$ curl -H 'Content-Type: application/json' -XPUT -d '{"_id": "org.couchdb.user:npm-user","name": "npm-user","roles": [],"type": "user","password": "npm-password","email":  "[email protected]"}' "http://my-user:my-password@localhost:5984/_users/org.couchdb.user:npm-user"

$ echo "_auth = $(echo -n npm-user:npm-password | base64)" >> .npmrc
$ echo "email = [email protected]" >> .npmrc