This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.db | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |