diff --git a/Dockerfile.rpi b/Dockerfile.rpi new file mode 100644 index 000000000..663d578ab --- /dev/null +++ b/Dockerfile.rpi @@ -0,0 +1,13 @@ +FROM hypriot/rpi-node:6-onbuild + +RUN mkdir -p /verdaccio/storage /verdaccio/conf + +WORKDIR /verdaccio + +ADD conf/docker.yaml /verdaccio/conf/config.yaml + +EXPOSE 4873 + +VOLUME ["/verdaccio/conf", "/verdaccio/storage"] + +CMD ["/usr/src/app/bin/verdaccio", "--config", "/verdaccio/conf/config.yaml", "--listen", "0.0.0.0:4873"] diff --git a/README.md b/README.md index 921881a40..5eccee126 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,15 @@ To build your own image: `docker build -t verdaccio .` +There is also an npm script for building the docker image, so you can also do: + +`npm run build-docker` + +If you want to use the docker image on a rpi or a compatible device there is also a dockerfile available. +To build the docker image for raspberry pi execute: + +`npm run build-docker:rpi` + To run the docker container: ``` @@ -67,6 +76,8 @@ docker run -it --rm --name verdaccio -p 4873:4873 \ verdaccio ``` +Please note that for any of the above docker commands you need to have docker installed on your machine and the docker executable should be available on your `$PATH`. + ### Ansible A Verdaccio playbook [is available at galaxy](https://galaxy.ansible.com/030/verdaccio) source: https://github.com/030/ansible-verdaccio diff --git a/package.json b/package.json index fd477bdf5..0a70324a6 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,9 @@ "test:coverage": "nyc --reporter=html --reporter=text mocha -R spec ./test/functional ./test/unit", "test-travis": "eslint . && npm run test:coverage", "test-only": "mocha ./test/functional ./test/unit", - "lint": "eslint ." + "lint": "eslint .", + "build-docker": "docker build -t verdaccio .", + "build-docker:rpi": "docker build -f Dockerfile.rpi -t verdaccio:rpi ." }, "engines": { "node": ">=0.10"