From f66bd8643b68ef7cbc7c88b5aecb56cee9f9a1db Mon Sep 17 00:00:00 2001 From: Jeremy Price Date: Thu, 16 Feb 2017 15:47:13 -0800 Subject: [PATCH] [n1cloud][docker][logs] added pm2 wrapper for logs Launching pm2 via a wrapper that launches pm2 as a daemon in the background and then runs pm2 logs --raw in the foreground. This gets us the logs that we want without the additional cruft that pm2 outputs by default --- Dockerfile | 3 ++- _n1cloud_docker_launcher.sh | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 _n1cloud_docker_launcher.sh diff --git a/Dockerfile b/Dockerfile index f3775f855..b8090c6e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,4 +25,5 @@ EXPOSE 5100 # We use a start-aws command that automatically spawns the correct process # based on environment variables (which changes instance to instance) -CMD ./node_modules/pm2/bin/pm2 start --no-daemon ./pm2-prod-${AWS_SERVICE_NAME}.yml +#CMD ./node_modules/pm2/bin/pm2 start --no-daemon ./pm2-prod-${AWS_SERVICE_NAME}.yml +CMD ./_n1cloud_docker_launcher.sh ${AWS_SERVICE_NAME} diff --git a/_n1cloud_docker_launcher.sh b/_n1cloud_docker_launcher.sh new file mode 100755 index 000000000..84ef79208 --- /dev/null +++ b/_n1cloud_docker_launcher.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +./node_modules/pm2/bin/pm2 start ./pm2-prod-$1.yml +./node_modules/pm2/bin/pm2 logs --raw