mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-23 22:27:34 -05:00
aea3b9ddaf
* add docker examples to use plugins at docker * Update Dockerfile * chore: add v6 examples
26 lines
1.2 KiB
Docker
26 lines
1.2 KiB
Docker
# Docs based on https://github.com/xlts-dev/verdaccio-prometheus-middleware#installation
|
|
# Docker multi-stage build - https://docs.docker.com/develop/develop-images/multistage-build/
|
|
# Use an alpine node image to install the plugin
|
|
FROM node:lts-alpine as builder
|
|
|
|
RUN mkdir -p /verdaccio/plugins
|
|
|
|
# Copy the local plugin into the docker image
|
|
ADD plugins/verdaccio-docker-memory /verdaccio/plugins/verdaccio-docker-memory
|
|
# Install the production dependencies (be careful install devDependencies here)
|
|
RUN cd /verdaccio/plugins/verdaccio-docker-memory \
|
|
&& npm install --production
|
|
|
|
# The final built image will be based on the standard Verdaccio docker image.
|
|
FROM verdaccio/verdaccio:nightly-master
|
|
|
|
# Copy the plugin files over from the 'builder' node image.
|
|
# The `$VERDACCIO_USER_UID` env variable is defined in the base `verdaccio/verdaccio` image.
|
|
# Refer to: https://github.com/verdaccio/verdaccio/blob/v5.2.0/Dockerfile#L32
|
|
# The local verdaccio-docker-memory is setup as storage
|
|
ADD docker.yaml /verdaccio/conf/config.yaml
|
|
|
|
# Copy the plugin into the /verdaccio/plugins
|
|
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
|
/verdaccio/plugins/verdaccio-docker-memory \
|
|
/verdaccio/plugins/verdaccio-docker-memory
|