Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix entrypoint to use exec so that SIGINT shutdown works #76

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

kjsanger
Copy link
Member

@kjsanger kjsanger commented Oct 8, 2024

Add a healthcheck to the Dockerfile

@kjsanger kjsanger added the bug Something isn't working label Oct 8, 2024
@kjsanger kjsanger requested a review from nerdstrike October 8, 2024 10:56
@nerdstrike
Copy link
Contributor

Well drat: encode/uvicorn#1579

@kjsanger
Copy link
Member Author

kjsanger commented Oct 8, 2024

Without this change, the container doesn't shut down cleanly. With it I get:

$ docker run -p 8081:8081 wsinpg/python-3.10-npg-porch-2.0.0:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Starting PostgreSQL 15 database server: main.
INFO:     Will watch for changes in these directories: ['/app']
INFO:     Uvicorn running on http://0.0.0.0:8081 (Press CTRL+C to quit)
INFO:     Started reloader process [7] using StatReload
INFO:     Started server process [44]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     127.0.0.1:59070 - "GET / HTTP/1.1" 200 OK
^CINFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [44]
INFO:     Stopping reloader process [7]

So it is an improvement even if within the container the server isn't necessarily behaving well. I'm not sure that I care about that here because the Dockerfile is dev/test only.

@kjsanger kjsanger changed the title Fix entrypoint to use exec so that SIGINT shuwdown works Fix entrypoint to use exec so that SIGINT shutdown works Oct 8, 2024
Copy link
Contributor

@nerdstrike nerdstrike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so.

@nerdstrike nerdstrike merged commit d7e3444 into wtsi-npg:devel Oct 8, 2024
1 check passed
@kjsanger kjsanger deleted the fix/entrypoint-exec branch October 8, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants