From ac8d5742d6703f03f429521850cc32e8f7358f9c Mon Sep 17 00:00:00 2001 From: Brian Aydemir Date: Thu, 21 Nov 2024 09:23:02 -0600 Subject: [PATCH] Run under supervisord (for automatic restarts) --- Dockerfile | 5 +++-- supervisor/api.conf | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 supervisor/api.conf diff --git a/Dockerfile b/Dockerfile index c1158358..ed1b2d98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM node:14-bullseye RUN apt-get -y update && \ apt-get -y install redis-tools postgresql-client && \ - apt-get -y install ca-certificates + apt-get -y install ca-certificates supervisor WORKDIR /code @@ -26,4 +26,5 @@ ENV NODE_PG_FORCE_NATIVE=1 COPY ./ /code/ -CMD npm start \ No newline at end of file +COPY ./supervisor/api.conf /etc/supervisor/conf.d/ +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf", "-n"] diff --git a/supervisor/api.conf b/supervisor/api.conf new file mode 100644 index 00000000..2c9f67e6 --- /dev/null +++ b/supervisor/api.conf @@ -0,0 +1,7 @@ +[program:api] +command = npm start +autorestart = true +stdout_logfile = /dev/stdout +stdout_logfile_maxbytes = 0 +stderr_logfile = /dev/stderr +stderr_logfile_maxbytes = 0