Skip to content

Instantly share code, notes, and snippets.

@siygle
Last active January 25, 2023 10:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save siygle/ce97365bb1a06ea4892f23f2ad5d6a43 to your computer and use it in GitHub Desktop.
Save siygle/ce97365bb1a06ea4892f23f2ad5d6a43 to your computer and use it in GitHub Desktop.
Setup verdaccio on dokku
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# Don't foreget use dokku storage to mount storage to the same path
storage: /verdaccio/storage
auth:
htpasswd:
file: /verdaccio/htpasswd
# You can set this to -1 to disable registration.
# Maximum amount of users allowed to register, defaults to "+infinity".
max_users: -1
# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@*/*':
# scoped packages
access: $authenticated
publish: $authenticated
proxy: npmjs
'**':
# allow all users (including non-authenticated users) to read and
# publish all packages
#
# you can specify usernames/groupnames (depending on your auth plugin)
# and three keywords: "$all", "$anonymous", "$authenticated"
access: $all
# allow all known users to publish packages
# (anyone can register by default, remember?)
publish: $authenticated
# if package is not available locally, proxy requests to 'npmjs' registry
proxy: npmjs
# log settings
logs:
- {type: stdout, format: pretty, level: http}
#- {type: file, path: verdaccio.log, level: info}
FROM node:8.6.0-alpine
LABEL maintainer="https://github.com/verdaccio/verdaccio"
RUN apk --no-cache add openssl && \
wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 && \
chmod +x /usr/local/bin/dumb-init
# If you want "dokku enter" don't forget install bash
# https://github.com/dokku/dokku/issues/2572
RUN apk update && \
apk add bash && \
apk add bash-doc && \
apk add bash-completion
WORKDIR /verdaccio
RUN wget -O verdaccio.tar.gz https://github.com/verdaccio/verdaccio/archive/v2.4.0.tar.gz && \
tar zxvf verdaccio.tar.gz --strip-components 1
RUN npm config set registry http://registry.npmjs.org/ && \
npm install -g -s --no-progress yarn --pure-lockfile && \
yarn install --production=false && \
yarn run build:webui
ENV NODE_ENV=production
RUN yarn cache clean && \
yarn install --production=true --pure-lockfile
# Don't forget prepare your own config.yaml & htpasswd if you need
ADD ./docker.yaml config.yaml
ADD ./htpasswd htpasswd
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
CMD /verdaccio/bin/verdaccio --config /verdaccio/config.yaml --listen http://0.0.0.0:4873
EXPOSE 4873
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment