mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
commit
2cceccad55
3 changed files with 56 additions and 9 deletions
23
Dockerfile
23
Dockerfile
|
@ -1,13 +1,24 @@
|
||||||
FROM node:6.1.0-onbuild
|
FROM node:6-alpine
|
||||||
|
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
||||||
|
|
||||||
|
ENV APPDIR /usr/local/app
|
||||||
|
|
||||||
|
RUN mkdir -p "$APPDIR"
|
||||||
|
WORKDIR $APPDIR
|
||||||
|
ADD . $APPDIR
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
RUN mkdir -p /verdaccio/storage /verdaccio/conf
|
RUN mkdir -p /verdaccio/storage /verdaccio/conf
|
||||||
|
|
||||||
WORKDIR /verdaccio
|
|
||||||
|
|
||||||
ADD conf/docker.yaml /verdaccio/conf/config.yaml
|
ADD conf/docker.yaml /verdaccio/conf/config.yaml
|
||||||
|
|
||||||
|
RUN addgroup -S verdaccio && adduser -S -g verdaccio verdaccio && \
|
||||||
|
chown -R verdaccio:verdaccio "$APPDIR" && \
|
||||||
|
chown -R verdaccio:verdaccio /verdaccio
|
||||||
|
|
||||||
|
USER verdaccio
|
||||||
|
|
||||||
EXPOSE 4873
|
EXPOSE 4873
|
||||||
|
|
||||||
VOLUME ["/verdaccio/conf", "/verdaccio/storage"]
|
VOLUME ["/verdaccio"]
|
||||||
|
|
||||||
CMD ["/usr/src/app/bin/verdaccio", "--config", "/verdaccio/conf/config.yaml", "--listen", "0.0.0.0:4873"]
|
CMD ["sh", "-c", "${APPDIR}/bin/verdaccio --config /verdaccio/conf/config.yaml --listen 0.0.0.0:4873"]
|
||||||
|
|
30
README.md
30
README.md
|
@ -102,16 +102,40 @@ To build the docker image for raspberry pi execute:
|
||||||
```bash
|
```bash
|
||||||
npm run build-docker:rpi
|
npm run build-docker:rpi
|
||||||
```
|
```
|
||||||
|
|
||||||
To run the docker container:
|
To run the docker container:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
docker run -it --rm --name verdaccio -p 4873:4873 \
|
docker run -it --rm --name verdaccio -p 4873:4873 \
|
||||||
-v /<path to verdaccio directory>/conf:/verdaccio/conf \
|
-v /<path to verdaccio directory>/conf:/verdaccio/conf \
|
||||||
-v /<path to verdaccio directory>/storage:/verdaccio/storage \
|
-v /<path to verdaccio directory>/storage:/verdaccio/storage \
|
||||||
-v /<path to verdaccio directory>/local_storage:/verdaccio/local_storage \
|
|
||||||
verdaccio/verdaccio
|
verdaccio/verdaccio
|
||||||
```
|
```
|
||||||
|
Note: The build might take some minutes to build locally.
|
||||||
|
|
||||||
|
#### Using docker-compose
|
||||||
|
|
||||||
|
1. Get the latest version of [docker-compose](https://github.com/docker/compose).
|
||||||
|
2. Build and run the container:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker-compose up --build
|
||||||
|
```
|
||||||
|
|
||||||
|
Docker will generate a named volume in which to store persistent application data. You can use `docker inspect` or `docker volume inspect` to reveal the physical location of the volume and edit the configuration, such as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker volume inspect verdaccio_verdaccio
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"Name": "verdaccio_verdaccio",
|
||||||
|
"Driver": "local",
|
||||||
|
"Mountpoint": "/var/lib/docker/volumes/verdaccio_verdaccio/_data",
|
||||||
|
"Labels": null,
|
||||||
|
"Scope": "local"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
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`.
|
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`.
|
||||||
|
|
||||||
|
|
12
docker-compose.yaml
Normal file
12
docker-compose.yaml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
verdaccio:
|
||||||
|
build: .
|
||||||
|
container_name: verdaccio
|
||||||
|
ports:
|
||||||
|
- "4873:4873"
|
||||||
|
volumes:
|
||||||
|
- verdaccio:/verdaccio
|
||||||
|
volumes:
|
||||||
|
verdaccio:
|
||||||
|
driver: local
|
Loading…
Reference in a new issue