julie-ng / hello-welt

Simple containerized Node.js app for demos.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hello-welt

ci docker Known Vulnerabilities

Hello Welt Preview

Earth icon by iconmonstr.com

Configuration

The following variables can be configured

Environment Variable Default
VERSION Version from package.json
HELLO_GREETING Hello
HELLO_NAME Welt
HELLO_COLOR #ff5757
EARTH_COLOR #57ffd1
PORT 3000
HOST localhost in development and 0.0.0.0 in production

Usage

You can use this Docker image directly in demos or use it as a simple Node.js app

Docker Image

Pull the julieio/hello public image from Docker Hub and then run it:

docker pull julieio/hello:latest
docker run -p 3000:3000 julieio/hello:latest

Optionally - pass configuration via environment variables:

docker run -p 3000:3000 -e HELLO_NAME=Julie julieio/hello:latest

or build from scratch

docker build . -t hello-welt
docker run -p 3000:3000 hello-welt

Node.js App

After cloning this repo, install dependencies

git clone https://github.com/julie-ng/hello-welt
npm install

Start the app

npm start

and then open http://localhost:3000 in your browser.

Local Development

For local development, we will use pino-pretty to format logs with color

npm install -g pino-pretty

We also also use nodemon to automatically restart the app when code changes. Use the dev command to put everything together

npm run dev

which is a shortcut for

NODE_ENV=development nodemon -w app app/server.js | pino-pretty

References

About

Simple containerized Node.js app for demos.

License:MIT License


Languages

Language:JavaScript 49.8%Language:Handlebars 48.5%Language:Dockerfile 1.7%