Skip to content

Commit f0cae1a

Browse files
alon-codefreshitai-codefresh
authored andcommitted
Restart the container logger in case it crashes (#6)
1 parent d2412a4 commit f0cae1a

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ coverage/*.html
66
.debug
77
coverage
88
state.json
9-
*.log
9+
*.log
10+
.idea

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
FROM node:onbuild
22

3-
CMD ["node", "lib/index.js"]
3+
#CMD ["node", "lib/index.js"]
4+
CMD ["node", "node_modules/.bin/forever", "--minUptime", "1", "--spinSleepTime", "1000", "-c", "node", "lib/index.js"]

lib/logger.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ class Logger {
2020
this.firebaseSecret = firebaseSecret;
2121
this.loggerId = loggerId;
2222
this.findExistingContainers = findExistingContainers === 'true';
23-
this.docker = new Docker();
23+
this.docker = new Docker({
24+
socketPath: '/var/run/codefresh/docker.sock',
25+
});
2426
}
2527

2628
/**

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"cf-logs": "git+https://github.com/codefresh-io/cf-logs.git#ceba4f309e52a077747a0c6bf9c3ad02e762dc4b",
1111
"dockerode": "^2.3.0",
1212
"firebase": "^2.4.1",
13+
"forever": "^0.15.3",
1314
"lodash": "^4.15.0",
1415
"q": "^1.4.1"
1516
},

0 commit comments

Comments
 (0)