Skip to content

Minimal Go app server deployment with nginx load balancer

Notifications You must be signed in to change notification settings

danryu/project_s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

project_s

Minimal Go application deployment example using Vagrant, Ansible, Docker, docker-compose.

The deployment consists of 2 x Go application servers (derived from the official Docker golang image) and 1 x nginx load-balancer (in round-robin configuration, derived from official Nginx image).

In general, the absolute minimum configuration code has been applied, to demonstrate the efficiency of the tools being used. (Only around 100 lines of code is needed to implement all the above.)

Requirements

Only one requirement: Vagrant 1.8+

Installation

Clone the project: # git clone https://github.com/danryu/project_s.git

Invocation

Change directory to project clone directory and execute:

# vagrant up

Operation

From project clone directory on host:

# vagrant ssh

You will now be logged in as user "vagrant".

Check the operation of the Go nodes and the Nginx round-robin load-balancer:

# curl localhost

And repeat to see the server node alternate.

Automated deployment of changes

The ansible and docker configurations are made with idempotency in mind. After making edits to the sampleHi directory, a simple

# vagrant provision

run from the Vagrant host (in the project clone dir) will restart the Docker containers with the new code applied.

About

Minimal Go app server deployment with nginx load balancer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages