Skip to content

Commit

Permalink
Run under supervisord (for automatic restarts)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianaydemir committed Nov 21, 2024
1 parent 26bd305 commit ac8d574
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -26,4 +26,5 @@ ENV NODE_PG_FORCE_NATIVE=1

COPY ./ /code/

CMD npm start
COPY ./supervisor/api.conf /etc/supervisor/conf.d/
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf", "-n"]
7 changes: 7 additions & 0 deletions supervisor/api.conf
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ac8d574

Please sign in to comment.