Run server as PID 1 in Docker to drop idle launcher processes
The container CMD ran `npm run start-docker`, i.e. `npm-run-all check-db update-tracker start-server`. After the one-shot tasks exit, three Node VMs stay resident for the container lifetime (npm -> npm-run-all -> npm -> node server.js), each holding tens of MiB of anonymous memory for nothing. Replace it with a small start script that runs the one-shot steps and then `exec node server.js`, so the server becomes PID 1 and no launcher wrappers remain. On a dev 3.2.0 build under realistic load the container RSS dropped ~28% (memory.stat anon 255 MiB -> 183 MiB); migrations still apply and /api/heartbeat serves normally.
This commit is contained in:
1 parent
0862518ec7
commit
d13085fdd6
2 files changed
+17
-1
No files matched your search
+1
-1
@@ -76,4 +76,4 @@ EXPOSE 3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
CMD ["npm", "run", "start-docker"]
|
||||
CMD ["sh", "scripts/start-docker.sh"]
|
||||
Reference in new issue
Block a user