From 35fc0b9ea87d043c8ad3087862f9818924e0805b Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Tue, 24 Nov 2015 20:20:32 +0200 Subject: [PATCH] remove buildfiles related to old deployment platform --- Dockerfile | 37 ------------------------------------- Procfile | 1 + build_docker | 15 --------------- newrelic.js | 19 +++++++++++++++++++ 4 files changed, 20 insertions(+), 52 deletions(-) delete mode 100644 Dockerfile create mode 100644 Procfile delete mode 100755 build_docker create mode 100644 newrelic.js diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 9c77bb8..0000000 --- a/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM ubuntu:trusty -MAINTAINER "Niko Kurtti niko@salaliitto.com" - -ENV NODE_VER v0.10.25 -ENV PORT 9000 - -RUN apt-get update -RUN apt-get install -y git build-essential libssl-dev curl - -RUN groupadd -r koodiklinikka-api && useradd --create-home -r -g koodiklinikka-api koodiklinikka-api - -ADD . /home/koodiklinikka/koodiklinikka.fi-api - -RUN chown -R koodiklinikka-api:koodiklinikka-api /home/koodiklinikka/koodiklinikka.fi-api - -USER koodiklinikka-api - -RUN git clone https://github.com/creationix/nvm ~/.nvm -RUN cd ~/.nvm && git checkout `git describe --abbrev=0 --tags` -RUN /bin/bash -c "source ~/.nvm/nvm.sh \ - && nvm install ${NODE_VER} \ - && nvm alias koodiklinikka.fi-api ${NODE_VER}" - -WORKDIR /home/koodiklinikka/koodiklinikka.fi-api - -RUN /bin/bash -c "source ~/.nvm/nvm.sh \ - && nvm use koodiklinikka.fi-api \ - && npm install" - -RUN cp node_modules/newrelic/newrelic.js . -RUN NR_KEY=$(cat config.json |grep newrelic_key|cut -d'"' -f4) && sed -i "s/license key here/$NR_KEY/g" newrelic.js -RUN sed -i "s/My Application/koodiklinikka.fi-api/g" newrelic.js - -CMD NODE_ENV=$NODE_ENV PORT=$PORT /bin/bash -c "source ~/.nvm/nvm.sh \ - && nvm use koodiklinikka.fi-api \ - && node index.js >> ~/koodiklinikka.fi-api.log 2>&1" -EXPOSE $PORT diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..1da0cd6 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: node index.js diff --git a/build_docker b/build_docker deleted file mode 100755 index 1ee9184..0000000 --- a/build_docker +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -if [[ -z "$1" ]] - then - KEYROOT=$HOME -else - KEYROOT=$1 -fi - -gem install ejson - -ejson --keydir=$KEYROOT/.ejson decrypt config/config.production.ejson > config.json - -docker build -t koodiklinikka.fi-api . - -rm -rf config.json diff --git a/newrelic.js b/newrelic.js new file mode 100644 index 0000000..e91c51f --- /dev/null +++ b/newrelic.js @@ -0,0 +1,19 @@ +var config = require('./lib/config'); +exports.config = { + /** + * Array of application names. + */ + app_name: ['My Application'], + /** + * Your New Relic license key. + */ + license_key: config.newrelic.key, + logging: { + /** + * Level at which to log. 'trace' is most useful to New Relic when diagnosing + * issues with the agent, 'info' and higher will impose the least overhead on + * production applications. + */ + level: 'info' + } +}