mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 03:01:23 +01:00
feat: allow asgi/wsgi to be configurable by env var (#21635)
allow asgi/wsgi to be configurable by env var This will let us roll out asgi separate across services as we had issues with our recordings capture pods on asgi
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
!plugin-server/.prettierrc
|
||||
!share/GeoLite2-City.mmdb
|
||||
!hogvm/python
|
||||
!unit.json
|
||||
!unit.json.tpl
|
||||
!plugin-transpiler/src
|
||||
!plugin-transpiler/*.*
|
||||
!test-runner-jest.config.js
|
||||
|
||||
@@ -11,6 +11,9 @@ trap 'rm -rf "$PROMETHEUS_MULTIPROC_DIR"' EXIT
|
||||
|
||||
export PROMETHEUS_METRICS_EXPORT_PORT=8001
|
||||
export STATSD_PORT=${STATSD_PORT:-8125}
|
||||
export NGINX_UNIT_PYTHON_PROTOCOL=${NGINX_UNIT_PYTHON_PROTOCOL:-wsgi}
|
||||
envsubst < /docker-entrypoint.d/unit.json.tpl > /docker-entrypoint.d/unit.json
|
||||
|
||||
|
||||
# We need to run as --user root so that nginx unit can proxy the control socket for stats
|
||||
# However each application is run as "nobody"
|
||||
|
||||
@@ -249,7 +249,8 @@ RUN apt-get update && \
|
||||
"libpq-dev" \
|
||||
"libxmlsec1" \
|
||||
"libxmlsec1-dev" \
|
||||
"libxml2"
|
||||
"libxml2" \
|
||||
"gettext-base"
|
||||
|
||||
# Install NodeJS 18.
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
@@ -311,6 +312,6 @@ EXPOSE 8000
|
||||
|
||||
# Expose the port from which we serve OpenMetrics data.
|
||||
EXPOSE 8001
|
||||
COPY unit.json /docker-entrypoint.d/unit.json
|
||||
COPY unit.json.tpl /docker-entrypoint.d/unit.json.tpl
|
||||
USER root
|
||||
CMD ["./bin/docker"]
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
"processes": 4,
|
||||
"working_directory": "/code",
|
||||
"path": ".",
|
||||
"module": "posthog.wsgi",
|
||||
"protocol": "wsgi",
|
||||
"module": "posthog.$NGINX_UNIT_PYTHON_PROTOCOL",
|
||||
"protocol": "$NGINX_UNIT_PYTHON_PROTOCOL",
|
||||
"user": "nobody",
|
||||
"limits": {
|
||||
"requests": 50000
|
||||
Reference in New Issue
Block a user