npm

Need private packages and team management tools?Check out npm Orgs. »

@pubcore/node-server-docker

1.4.1 • Public • Published

Create an ECMAScript (JavasScript) web server based on Node.js, express and docker

How to run/test this package, standalone on your local system

  1. latest version of docker, node and npm installed and running

  2. change to your development folder, where you may have other projects and clone this repository into it (which will create the project-dir)

     git clone git@github.com:pubcore/node-server-docker.git 		
    
  3. find/create ssl key- and certificate-files (ssl-files) for your local domain ... you need it for next step

  4. switch docker to swarm mode

     docker swarm init
    
  5. register secrets
    Create dhparam.pem file used below with (replace <pathToFile> with directory where the ssl-files stored in:

     openssl dhparam -out <pathToFile>dh-strong.pem 2048
    

Register keys and certificates created for your domain you are running your (local) development system

	docker secret create ssl-key <absolute path to ssl key file>
	docker secret create ssl-cert <absolute path to ssl crt (certificate) file>
	docker secret create ssl-dhparam <absolute path to dh-strong.pem file>
  1. change into project-dir

  2. register configs

     docker config create verdaccio ./verdaccio-config.yml
    
  3. install application packages

     npm install
    
  4. start server

    npm run start
    
  5. test it: you should see "Hello world!"

    https://<your-local-domain>:8443/
    

Configuration environment variables

  • APP_PORT
    Application's ports
  • NODE_ENV
    Type of environment, either 'development' or 'production'
  • RATE_WIN, RATE_MAX, RATE_DELAY
    Rate limit values, see https://www.npmjs.com/package/express-rate-limit
    Default values (Window: 5 min, Max: 300, Delay: 0)

install

npm i @pubcore/node-server-docker

Downloadsweekly downloads

5

version

1.4.1

license

MIT

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability