[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
This commit is contained in:
Jeremy Price 2017-02-16 15:47:13 -08:00
parent 25d88589ba
commit f66bd8643b
2 changed files with 6 additions and 1 deletions

View file

@ -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}

4
_n1cloud_docker_launcher.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
./node_modules/pm2/bin/pm2 start ./pm2-prod-$1.yml
./node_modules/pm2/bin/pm2 logs --raw