Skip to content

Commit

Permalink
Fix docker graceful shutdown (#830)
Browse files Browse the repository at this point in the history
* run.sh: Replace pid with nodejs's one using exec

This notably ensures that "docker stop" sends a TERM signal to the node
process which can handle it gracefully and avoid document corruption.

* Use exec form for CMD in Dockerfile

---------

Co-authored-by: Florent FAYOLLE <[email protected]>
  • Loading branch information
fflorent and Florent FAYOLLE authored Jan 30, 2024
1 parent f45c53d commit 36ade2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ ENV \

EXPOSE 8484

CMD ./sandbox/run.sh
CMD ["./sandbox/run.sh"]
2 changes: 1 addition & 1 deletion sandbox/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ if [[ "$GRIST_SANDBOX_FLAVOR" = "gvisor" ]]; then
./sandbox/gvisor/update_engine_checkpoint.sh
fi

NODE_PATH=_build:_build/stubs:_build/ext node _build/stubs/app/server/server.js
exec env NODE_PATH=_build:_build/stubs:_build/ext node _build/stubs/app/server/server.js

0 comments on commit 36ade2b

Please sign in to comment.