From dd84a2439fe1e24ea9df21193c5fc0def284620f Mon Sep 17 00:00:00 2001 From: Rafal Proszowski Date: Thu, 22 Nov 2018 10:20:22 +0000 Subject: [PATCH] Add documentation on Docker As we'd like to support Docker, we're providing documentation on why and when would an individual use it, as well as how to get around doing so. --- .../install/developer-install-instructions.md | 43 +++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/docs/documentation/install/developer-install-instructions.md b/docs/documentation/install/developer-install-instructions.md index 1dabb88225..d0facd0828 100644 --- a/docs/documentation/install/developer-install-instructions.md +++ b/docs/documentation/install/developer-install-instructions.md @@ -1,20 +1,57 @@ # Instructions for developers +There are multiple ways of running the application locally. + +## Native + It's built on the [Express](http://expressjs.com/) framework, and uses [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend). -## Requirements +### Requirements node.js - version 8.x.x -## Install dependencies +### Install dependencies ``` npm install ``` -## Run the kit +### Run the kit ``` npm start ``` Go to [localhost:3000](http://localhost:3000) in your browser. + +## Docker + +You may choose to run the application in the docker environment. Doing so you'd +probably be driven by some of the following: + +- avoid installing/managing node on your machine +- avoid remembering to install/compile dependencies +- running application in an artifact way + - ability to push to Kubernetes (RE Build & Run) or CloudFoundry (GOV.UK PaaS) +- run in _production-like_ environment + +We've placed a `Dockerfile` in the root of the project. + +You can build an image by running the following: + +``` +docker build . -t govuk-prototype-kit:latest +``` + +This step will pull a small image containing a base operating system with node +pre-installed. Additionally, will mount your current working directory along +with installing some `node_modules`. + +You can run it afterwards with: + +``` +docker run -p 3000:3000 govuk-prototype-kit:latest +``` + +The application will listen on your exposed port (`3000` in this case). You +should be able to visit http://localhost:3000/ +