Title: Revise `Dockerfile` for use in Kubernetes or provide additional configuration documentation · Issue #81 · anomaly/lab-python-server · GitHub
Open Graph Title: Revise `Dockerfile` for use in Kubernetes or provide additional configuration documentation · Issue #81 · anomaly/lab-python-server
X Title: Revise `Dockerfile` for use in Kubernetes or provide additional configuration documentation · Issue #81 · anomaly/lab-python-server
Description: Is your feature request related to a problem? Please describe. When trying to use the template for a project that would run in Kubernetes, there were many things that didn't work. The Dockerfile for production does not provide a CMD whic...
Open Graph Description: Is your feature request related to a problem? Please describe. When trying to use the template for a project that would run in Kubernetes, there were many things that didn't work. The Dockerfile fo...
X Description: Is your feature request related to a problem? Please describe. When trying to use the template for a project that would run in Kubernetes, there were many things that didn't work. The Dockerfil...
Opengraph URL: https://github.com/anomaly/lab-python-server/issues/81
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Revise `Dockerfile` for use in Kubernetes or provide additional configuration documentation","articleBody":"**Is your feature request related to a problem? Please describe.**\r\nWhen trying to use the template for a project that would run in Kubernetes, there were many things that didn't work.\r\n\r\n- The `Dockerfile` for production does not provide a `CMD` which is expected for the container to run, either provide this or provide documentation for creating the `helm` chart to provide the `command` to run. Ideally we could do both, where if a `command` is not provided it runs the `fastapi` app and otherwise runs `taskiq` workers etc.\r\n- To make the template generic we have used the variable `PROJ_NAME` wherever possible, this has worked while we have used `docker compose` to run production workloads where it can find the environment variable but not much when it's running in a Kubernetes managed environment. This is particularly an issue with the `Dockerfile` itself where it references `PROJ_NAME` in the `uvicorn` command\r\n- Should we use `gunicorn` at all? Follow [this discussion](https://github.com/tiangolo/fastapi/discussions/7439#discussioncomment-5140961) on FastAPI discussion.\r\n\r\nThe `Dockerfile` has a section where we run as the project `User` this results in:\r\n\r\n```\r\nINFO: Started server process [1]\r\nINFO: Waiting for application startup.\r\nINFO: Application startup complete.\r\nERROR: [Errno 13] error while attempting to bind on address ('0.0.0.0', 80): permission denied\r\nINFO: Waiting for application shutdown.\r\nINFO: Application shutdown complete.\r\n```\r\n\r\nSee [bind() to 0.0.0.0:80 failed(13: Permission denied](https://github.com/kubernetes/ingress-nginx/issues/3858) where they [suggest to run the command as root](https://github.com/kubernetes/ingress-nginx/issues/3858#issuecomment-470099783)\r\n\r\n**Describe the solution you'd like**\r\nEither provide a programmatic solution to the above or extended documentation that allows developers to quickly use this template in production in Kubernetes.\r\n\r\n**Describe alternatives you've considered**\r\nNA\r\n\r\n**Additional context**\r\nAll relevant to the Kubernetes deployment","author":{"url":"https://github.com/devraj","@type":"Person","name":"devraj"},"datePublished":"2023-07-28T05:14:43Z","url":"https://github.com/anomaly/lab-python-server/issues/81"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aa4a4cf9-8255-b789-b211-1a2c504704b0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D560:3AACE0:6E3377:97964F:6B0479EB |
| html-safe-nonce | 6d3bc5f9fef86af528f61bae4f493d34250b891a1ece6e31c21bef57159a5e4a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTYwOjNBQUNFMDo2RTMzNzc6OTc5NjRGOjZCMDQ3OUVCIiwidmlzaXRvcl9pZCI6IjU0OTUwODY4MjUwODMyNzE2NTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2ba4766eac1336fa29789606c577774e31cc6c1ef92d7e7f2266aad0b6294c61 |
| hovercard-subject-tag | issue:1825719086 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/anomaly/lab-python-server/81/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68cee5dcf10ce7b3b4be81d87e66d96b1e7c182b8fae815e995d7fee54207e5a/anomaly/lab-python-server/issues/81 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68cee5dcf10ce7b3b4be81d87e66d96b1e7c182b8fae815e995d7fee54207e5a/anomaly/lab-python-server/issues/81 |
| og:image:alt | Is your feature request related to a problem? Please describe. When trying to use the template for a project that would run in Kubernetes, there were many things that didn't work. The Dockerfile fo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | devraj |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| turbo-cache-control | no-preview |
| go-import | github.com/anomaly/lab-python-server git https://github.com/anomaly/lab-python-server.git |
| octolytics-dimension-user_id | 3654837 |
| octolytics-dimension-user_login | anomaly |
| octolytics-dimension-repository_id | 491764445 |
| octolytics-dimension-repository_nwo | anomaly/lab-python-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 491764445 |
| octolytics-dimension-repository_network_root_nwo | anomaly/lab-python-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width