PierreBeucher / example-voting-app

Example Docker Compose app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example Voting App

Example Voting App adapted for Crafteo Training

Running the stack

Initialize Docker Swarm

You have two hosts at your disposal: host1 and host2 with Docker installed. We'll create a Docker Swarm with 2 nodes.

Commands to run on host1:

# ssh into host1:
#
#   ssh ubuntu@ssh ubuntu@host1.training.crafteo.io
#
# Init Docker swarm from host1
# Keep outputed token!
docker swarm init

Commands to run on host2:

# ssh into host1:
#
#   ssh ubuntu@ssh ubuntu@host2.training.crafteo.io
#
docker swarm join [TOKEN]

Run the stack

# ssh into host1:
#
#   ssh ubuntu@ssh ubuntu@host1.training.crafteo.io
#

# Clone Voting App repo
git clone https://github.com/PierreBeucher/example-voting-app.git
cd example-voting-app

# Run the stack
docker stack up voting-app -c docker-stack.yml

App should be accessible (make sure to replace host1 by your actual hostname):

About

Example Docker Compose app

License:Apache License 2.0


Languages

Language:C# 22.5%Language:JavaScript 21.4%Language:CSS 14.8%Language:HTML 13.1%Language:Shell 12.1%Language:Dockerfile 8.5%Language:Python 5.5%Language:Makefile 2.0%