Skip to content

Commit

Permalink
Set up a basic docker development container
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldfallen committed Aug 7, 2017
0 parents commit 1d1442c
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node

ARG NODE_ENV=development
ENV NODE_ENV $NODE_ENV

WORKDIR /usr/src
COPY package.json /usr/src
RUN yarn install && yarn cache clean --force
ENV PATH /usr/src/node_modules/.bin:$PATH
ENV NPM_CONFIG_PREFIX /usr/src/node_modules

WORKDIR /usr/src/app
COPY . /usr/src/app

CMD ["yarn", "test"]
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: build test

define compose
docker-compose $(1)
endef

define yarn
$(call compose, run dev yarn $1)
endef

all: build bash

build:
$(call compose, build --pull)

bash:
$(call compose, run --service-ports dev bash)

test:
$(call yarn, $@)
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '2.1'

services:
dev:
build:
context: .
volumes:
- .:/usr/src/app
ports:
- "9229:9229"
- "3000:3000"
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@hmcts/look-and-feel",
"description": "One question per page apps made easy",
"version": "0.0.1",
"license": "MIT",
"engines": {
"node": ">=6.0"
},
"main": "./src/main.js",
"scripts": {
"test": "NODE_PATH=. NODE_ENV=testing mocha 'test/**/*.test.js'"
},
"dependencies": {
"express": "^4.15.3",
"express-nunjucks": "^2.2.3",
"govuk_template_jinja": "^0.22.3",
"nunjucks": "^3.0.1"
},
"devDependencies": {
"eslint": "^4.4.0"
}
}

0 comments on commit 1d1442c

Please sign in to comment.