Skip to content
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.

Commit

Permalink
Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dhcole committed Aug 26, 2015
1 parent da2ec42 commit fd481ee
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
37 changes: 37 additions & 0 deletions Dockerfile
@@ -0,0 +1,37 @@
FROM node:0.10-onbuild

# Expose environment variables
ENV BRANCH= \
NEW_RELIC_APP_NAME= \
NEW_RELIC_LICENSE_KEY= \
LINKEDIN_CLIENT_ID= \
LINKEDIN_CLIENT_SECRET= \
LINKEDIN_CALLBACK_URL= \
MYUSA_CLIENT_ID= \
MYUSA_CLIENT_SECRET= \
MYUSA_CALLBACK_URL= \
MYUSA_CLIENT_ID= \
MYUSA_CLIENT_SECRET= \
AWS_ACCESS_KEY_ID= \
AWS_SECRET_ACCESS_KEY= \
EMAIL_HOST= \
EMAIL_USER= \
EMAIL_PASS= \
EMAIL_SYSTEM_ADDRESS= \
NOTIFICATIONS_CC= \
NOTIFICATIONS_BCC= \
DATASTORE=local \
FILESTORE= \
S3_BUCKET= \
S3_PREFIX= \
SAILS_LOG_LEVEL= \
PORT=3000

# Run additional npm install scripts
RUN npm run init

# Make internal port available to host
EXPOSE 3000

# Start script
ENTRYPOINT ["./tools/docker-start.sh"]
14 changes: 14 additions & 0 deletions tools/docker-start.sh
@@ -0,0 +1,14 @@
#!/bin/bash

if [ $BRANCH ]; then
# Git complains without credentials
git config --global user.email "name@example.com"
git config --global user.name "Example Name"
git checkout -b $BRANCH master
git checkout $BRANCH
git pull git://github.com/18f/federalist.git $BRANCH
if [ "$BRANCH" != "master" ]; then
npm install --unsafe-perm
fi
fi
npm start

0 comments on commit fd481ee

Please sign in to comment.