/docker-nginx-small-light

an ngx_small_light docker image

Primary LanguageHCL

ngx_small_light Docker image

A docker image containing Nginx compiled with ngx_small_light

See Makefile for tasks.

Testing

  make test

Testing with a local dockerized http server using docker-compose. The compose file is dynamically generated using ERB to include docker-machine ip and random server ports. Run the tests once to generate your compose file.

Deploying to production

Deploying this project to production is kind of manual at the moment. First build the docker image and push it to docker hub with the production tag

  make push_production

Terraform knows to pull the image with the production tag (as you an see here)

First let's visit the ELBs version end-point and check the current git sha deployed.

Now we have to get terraform to pull the latest image.

  • In AWS console do to the EC2 service and rename the images-coreos instances to something you can easily recognize. e.g images-coreos-1, images-coreos-2
  • Go to the images-coreos autoscaling group.
  • Scale it to double the current amount of instances.
  • Once the goup has completely scaled detach the instances you previously renamed.
  • Monitor that while strictly working on the new scaled instances there are no issues.

Once the new machines are healthy visit the ELBs version end-point and if all went well you should now see the new git sha.

Now you can terminate the old machines (The ones that were renamed at the beginning of this process)

  • In ECS console filter down to coreos and sort by name
  • Select and terminate
  • Remember to dial the health check period back to 300 seconds when you are done

Finally, a manual check that it went well.