Last active
January 25, 2023 10:45
-
-
Save siygle/ce97365bb1a06ea4892f23f2ad5d6a43 to your computer and use it in GitHub Desktop.
Setup verdaccio on dokku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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