Sample HapiJs Example to run on a docker container
After cloning this repo, run the below docker command in the project dir.
$ docker build -t /hapijs-hello .
To confrim that the image was built successfully, run the code below:
$ docker images
This will give you the list of images. If your build was successful you should see /hapijs-hello in the list.
Run the following code to start your docker image:
$ docker run -d -p 3000:3000 /hapijs-hello
You can get the port of your app with the following code:
$ docker ps
ID IMAGE COMMAND ... PORTS
ecce33b30ebf /hapijs-hello:latest npm start ... 3000->3000
Now you can call your app using curl
$ curl -i 0.0.0.0:3000
If everything works out well, you should get a 200 Ok response with Hello world!