From c446e4ec58e9f5688e7c5031d7b5677fd078263e Mon Sep 17 00:00:00 2001 From: Matthew Lopez <73856503+MatthewL246@users.noreply.github.com> Date: Mon, 3 Jun 2024 19:13:51 -0400 Subject: [PATCH] fix: prevent container stop from timing out This switches the CMDs to array syntax to avoid invoking a shell, which seems to prevent the stop signal from working correctly in both containers. Also switches from pm2 to pm2-runtime, as is recommended for running pm2 inside Docker. --- dns/Dockerfile | 2 +- nginx/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/Dockerfile b/dns/Dockerfile index b209613..68928e0 100644 --- a/dns/Dockerfile +++ b/dns/Dockerfile @@ -43,4 +43,4 @@ COPY package.json . COPY --from=dependencies ${app_dir}/node_modules ${app_dir}/node_modules COPY --from=build ${app_dir}/dist ${app_dir}/dist -CMD pm2 start . --no-daemon +CMD ["pm2-runtime", "start", "."] diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 78cb593..f86f94d 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -69,4 +69,4 @@ COPY nginx.default.conf /opt/nginx/conf/nginx.conf EXPOSE 80 443 # * Start nginx -CMD nginx -g 'daemon off;' +CMD ["nginx", "-g", "daemon off;"]