1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-08 23:25:51 +01:00

migrate docker-https-portal example from V4 to V6 (#2687)

This commit is contained in:
Diana Morales 2021-11-20 08:02:17 +01:00 committed by GitHub
parent 24b9be0202
commit 29b1d59b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 5084 additions and 0 deletions

@ -5,3 +5,4 @@
- [Docker + Nginx + Verdaccio](reverse_proxy/nginx/README.md)
- [Docker + Apache + Verdaccio](apache-verdaccio/README.md)
- [Docker + Local Storage Volume + Verdaccio](docker-local-storage-volume/README.md)
- [Docker + HTTPS Portal + Verdaccio](https-portal-example/README.md)

@ -0,0 +1,69 @@
# Verdaccio and https-portal Example
Run `verdaccio` under fully automated HTTPS server powered by Nginx, Let's Encrypt was never so easy. Using [https-portal](https://github.com/SteveLTN/https-portal) all is builtin and no need for extra configuration.
## Prerequisites
In order to make it work, this is just a local setup, so you must update your `host` file.
On Mac
```
➜ sudo vi /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
127.0.0.1 example.com
```
## Usage
To run the containers, run the followingcommands in this folder, it should start the containers in detach mode.
```bash
docker-compose up -d
```
To recreate the nginx image you can force the build.
```bash
docker-compose up --build -d
```
To force recreate the images.
```bash
docker-compose up --build --force-recreate -d
```
To stop all containers
```bash
docker-compose stop
```
From your Javascript project
```bash
npm publish --registry https://example.com
```
## NPM and self-signed certificates
Be aware of disabling strict SSL in `./npmrc`config file as explained [here](https://stackoverflow.com/questions/9626990/receiving-error-error-ssl-error-self-signed-cert-in-chain-while-using-npm).
```bash
npm config set strict-ssl false
```
## Login
If you want to login into the Verdaccio instance created via these Docker Examples, please try:
Username: jpicado
Password: jpicado

@ -0,0 +1,28 @@
plugins: /verdaccio/plugins
storage: /verdaccio/storage
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
middlewares:
audit:
enabled: true
packages:
'@*/*':
access: $all
publish: $all
proxy: npmjs
'**':
access: $all
publish: $all
proxy: npmjs
logs:
- { type: stdout, format: pretty, level: trace }

@ -0,0 +1 @@
jpicado:$6vkdNgRX2npc:autocreated 2018-09-22T10:24:17.535Z

@ -0,0 +1,20 @@
services:
verdaccio:
image: verdaccio/verdaccio:nightly-master
container_name: verdaccio-https
ports:
- '4873:4873'
volumes:
- './storage:/verdaccio/storage'
- './conf:/verdaccio/conf'
https-portal:
image: steveltn/https-portal:1
ports:
- '80:80'
- '443:443'
links:
- verdaccio:verdaccio
environment:
DOMAINS: 'example.com -> http://verdaccio:4873'
STAGE: local
FORCE_RENEW: 'true'

@ -0,0 +1,51 @@
{
"name": "@scope/example",
"versions": {
"1.0.0": {
"name": "@scope/example",
"version": "1.0.0",
"description": "exampled scoped module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"example"
],
"author": {
"name": "Juan Picado"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.3.1"
},
"_id": "@scope/example@1.0.0",
"_npmVersion": "6.3.0",
"_nodeVersion": "10.1.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-UrpRhmCAwyGF2pWWd+fGDN8tFsVcCoLmK/qHaVAamphR+E4ZUjGf6N5GGgneFwbSeZ0FQrDYtUTPKrysxGIihQ==",
"shasum": "4c36e40e65049b32cd49599f65cb50b81b9d8810",
"tarball": "http://example.com/@scope/example/-/@scope/example-1.0.0.tgz"
}
}
},
"time": {
"modified": "2018-09-22T10:27:32.723Z",
"created": "2018-09-22T10:27:32.723Z",
"1.0.0": "2018-09-22T10:27:32.723Z"
},
"dist-tags": {
"latest": "1.0.0"
},
"_uplinks": {},
"_distfiles": {},
"_attachments": {
"example-1.0.0.tgz": {
"shasum": "4c36e40e65049b32cd49599f65cb50b81b9d8810",
"version": "1.0.0"
}
},
"_rev": "7-24f17006c03f69b9",
"readme": "ERROR: No README data found!"
}

File diff suppressed because it is too large Load Diff