]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/commitdiff
Use forever in the container
authorJohannes Zellner <johannes@nebulon.de>
Sat, 27 Jun 2015 17:59:11 +0000 (19:59 +0200)
committerJohannes Zellner <johannes@nebulon.de>
Sat, 27 Jun 2015 17:59:11 +0000 (19:59 +0200)
Dockerfile
package.json
start.sh [new file with mode: 0755]

index 87ed80d2e6882a9d63032aaa9be5abf2a1fb7872..c82a944837de170984e85a16d94c8df0b7b043b5 100644 (file)
@@ -10,8 +10,11 @@ ADD package.json /app/code/package.json
 ADD src /app/code/src
 ADD app.js /app/code/app.js
 ADD app /app/code/app
+ADD start.sh /app/code/start.sh
 RUN npm install
 
+RUN npm install -g forever
+
 EXPOSE 3000
 
-CMD [ "nodejs", "app.js"]
+CMD [ "/app/code/start.sh" ]
index d10b7336d53903002acfc7b61961cd9c2b0cbaad..99440c252cb11ebbf4912d3dddd9827bfde15ddc 100644 (file)
@@ -33,6 +33,8 @@
     "morgan": "^1.6.0",
     "multiparty": "^4.1.2",
     "passport": "^0.2.2",
+    "passport-ldapjs": "^1.0.2",
+    "readline-sync": "^1.2.19",
     "safetydance": "0.0.16",
     "superagent": "^1.2.0",
     "underscore": "^1.8.3"
diff --git a/start.sh b/start.sh
new file mode 100755 (executable)
index 0000000..84ea5ef
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -eu
+
+export NODE_ENV=production
+
+forever start --workingDir /app/code app.js
+forever logs -f 0
\ No newline at end of file