Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
pwalsh committed Feb 15, 2017
1 parent 33956f2 commit 7eb7740
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.db
*.log
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM node:4.7.3-alpine

MAINTAINER Paul Walsh <paulywalsh@gmail.com>

ENV LANG=en_US.UTF-8 \
APP_DIR=/srv/app

COPY . ${APP_DIR}

WORKDIR ${APP_DIR}

RUN apk add --no-cache --virtual build-dependencies \
build-base \
linux-headers \
python-dev \
python \
openssl-dev \
readline-dev \
curl \
gcc \
git \
&& apk add --no-cache \
bash \
gettext \
ca-certificates \
openssl \
libpq \
postgresql-client \
make \
&& update-ca-certificates \
&& make install \
&& apk del build-dependencies

EXPOSE 5000

CMD make server
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.PHONY: help

.DEFAULT_GOAL := help

REPOSITORY := 'okfn/opendatasurvey'
SHELL := /bin/bash

help: # http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

install: ## install the dependencies for the app
npm install

release: ## tag a release from master and push to origin
bash -c '[[ -z `git status -s` ]]'
git tag -a -m release $(VERSION)
git push --tags

test: ## run the tests for the app
npm test

build: ## build the Docker image for this app
docker build --tag $(REPOSITORY) --rm=false .

login: ## Login to docker hub
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASSWORD

push: ## push the latest Docker image to DockerHub
docker push $(REPOSITORY)

shell: ## run an interactive bash session in the container
docker run -it $(REPOSITORY) /bin/bash

run: ## run the container
docker run $(REPOSITORY)

deploy: build login push

server: ## command to run the command as queue or server
npm start

0 comments on commit 7eb7740

Please sign in to comment.