This project is a very simple example built for a docker tutorial using Node, Express, and Angular 2. For more information about Docker and how to get started please take a look at the tutorials accompanying this project.
Docker Series — What is Docker?
Docker Series — Starting your first container
Docker Series — Creating your first Dockerfile
To build you will need the Angular CLI installed
To run you will need Node.js installed
To work with Docker you will need Docker installed
This project was generated with Angular CLI version 1.5.0.
To Build
ng build
To start the node server
node server.js $HOSTNAME
To pull the Docker image from the Pintail.ai Dockerhub
docker pull pintailai/pintail-whoami:0.0.1
To run the Offical Version
docker run -d --rm -p 80:80 --name pintail-whoami pintailai/pintail-whoami:0.0.1
To build the image
docker build -t pintail-whoami .
To run your local build
docker run -d --rm -p 80:80 --name pintail-whoami pintail-whoami
The docker-compose.yml file is designed to explain what Docker compose is and how it works. It simply spins up two containers by default the pintail whoami image and jwilder/nginx-proxy. The nginx proxy is designed to automatically route and load balence to docker images running on a network.
To start up the images using Docker compose
docker-compose up -d
To see the images running
docker-compose ps
To see the logs of all the containers Docker compose started
docker-compose logs -f
Once you can see that the images started up correctly go to localhost on you machine to see pintail-whoami running
To scale up the number of pintail-whoami containers running
docker-compose up --scale pintail-whoami=2 -d
After you have scaled up the number of pintail-whoami containers running greater than one you can refresh localhost and you should the ID beneath "Welcome to the Pintail.ai Docker Example!" change. This indicates that the nginx-proxy is forwarding you to different Docker containers!