Repository navigation
feat(deploy): various small changes to enable k8s deployments - #1994
Merged
Merged
Conversation
- Add GET /healthz returning 200 "ok" without touching the DB or redis, for k8s liveness/readiness probes; a test enforces the no-DB rule - Send Django's own log output to stderr via a root console handler; previously app log messages only reached Sentry - Set SECURE_PROXY_SSL_HEADER so request.is_secure() follows the ingress's X-Forwarded-Proto. Absolute URLs built from the request (verification/reset emails, the API's avatar_url) become https://.SSO payloads contain no URLs, so DiscourseConnect is unchanged.
- Skip `migrate` when RUN_MIGRATIONS=false, enables migrations to run as an init container or Job - Pass --noinput to migrate - Exec gunicorn so it runs as PID 1 and receives SIGTERM for pod shutdown handling
- Proxy to the app at 127.0.0.1:8080; docker-compose.yml runs nginx in the app container's network namespace so the same config works there - Log to stdout/stderr, cap uploads at 10M, cache avatars under /var/cache/nginx/avatar, drop the missing dynamic-module include - Pass the ingress's X-Forwarded-Proto through to the app - Take the client IP from X-Forwarded-For, trusting only the proxies in NGINX_TRUSTED_PROXIES; nginx-trusted-proxies.sh renders them at startup from /docker-entrypoint.d/ and rejects malformed entries Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.