Skip to content

Commit

Permalink
Add heroku-docker deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nikashitsa committed Apr 11, 2016
1 parent 9b1d21d commit b1147c4
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .dockerignore
@@ -0,0 +1,14 @@
.git
.gitignore
GPL-LICENSE.txt
README.md
docker-compose.yml
Dockerfile
node_modules
npm-debug.log
.DS_Store
.vagrant/
provisioning/
.idea/
build/
phonegap/
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,3 +8,4 @@ provisioners
.idea
/phonegap/env.json
/phonegap/release.keystore
/.env*
24 changes: 24 additions & 0 deletions Dockerfile
@@ -0,0 +1,24 @@
FROM heroku/cedar:14

# Which version of node?
ENV NODE_ENGINE 0.12.12
# Locate our binaries
ENV PATH /app/heroku/node/bin/:/app/user/node_modules/.bin:$PATH
# Create some needed directories
RUN mkdir -p /app/heroku/node /app/.profile.d
WORKDIR /app/user
# Install node
RUN curl -s https://s3pository.heroku.com/node/v$NODE_ENGINE/node-v$NODE_ENGINE-linux-x64.tar.gz | tar --strip-components=1 -xz -C /app/heroku/node
# Export the node path in .profile.d
RUN echo "export PATH=\"/app/heroku/node/bin:/app/user/node_modules/.bin:\$PATH\"" > /app/.profile.d/nodejs.sh

# Bundle install
COPY package.json /app/user/package.json
RUN npm version && \
npm install --unsafe-perm --ignore-scripts && \
npm rebuild && \
npm cache clean

COPY . /app/user/
RUN aperture open
RUN export $(cat .env) && echo $DB_HOST && npm run build
2 changes: 1 addition & 1 deletion Procfile
@@ -1 +1 @@
web: aperture link && npm start
web: npm start
3 changes: 2 additions & 1 deletion app.json
Expand Up @@ -72,5 +72,6 @@
{
"url": "https://github.com/CoinSpace/cs-heroku-buildpack-nodejs"
}
]
],
"image": "heroku/cedar:14"
}
8 changes: 8 additions & 0 deletions deploy.sh
@@ -0,0 +1,8 @@
#!/bin/bash

APP=$1
if [ -z $APP ]; then APP=dev-coinspace; fi

echo "=== APP: $APP ==="
cp .env.$APP .env
heroku docker:release --app $APP
8 changes: 8 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,8 @@
web:
build: .
command: 'bash -c ''npm start'''
working_dir: /app/user
environment:
PORT: 8080
ports:
- '8080:8080'

0 comments on commit b1147c4

Please sign in to comment.