/docker-node-mfa-tutorial

Code for Add 2-Factor Authentication with Google Authenticator in Node.js

Primary LanguageEJS

Add MFA/2FA Authentication with Google Authenticator

*So why this?

I wanted to extend the tutorial with docker

Installation

After cloning this repository, install the dependencies:

npm i

Run the APP

Run the 'APP' with the following command:

npm start

The 'APP' will run at port 3000 if you do not change the config/default.json

Test it

Open your browser http://localhost:3000

Ready for docker

Create docker container

Build and tag you Docker container (eg: mfa)

docker build . -t mfa

Start the MFA Docker image

docker run -p 3000:3000 -d mfa

The server will run at port 3000 if you do not change

  • config/default.json
  • Dockerfile (expose port)

Test it

Open your browser http://localhost:3000