Skip to content

fix: propagate NEXT_PUBLIC_HELICONE_JAWN_SERVICE from docker-compose into env.js#5613

Open
shouryamaanjain wants to merge 1 commit intoHelicone:mainfrom
shouryamaanjain:fix/docker-env-propagation-5551
Open

fix: propagate NEXT_PUBLIC_HELICONE_JAWN_SERVICE from docker-compose into env.js#5613
shouryamaanjain wants to merge 1 commit intoHelicone:mainfrom
shouryamaanjain:fix/docker-env-propagation-5551

Conversation

@shouryamaanjain
Copy link

@shouryamaanjain shouryamaanjain commented Feb 28, 2026

Summary

  • Removed %(ENV_...)s variable re-declarations from supervisord.conf for both the web and jawn programs — these vars (NEXT_PUBLIC_HELICONE_JAWN_SERVICE, BETTER_AUTH_SECRET, S3_*) are already set as ENV defaults in the Dockerfile and are automatically inherited by supervisord child processes
  • Added docker-entrypoint.sh that generates __ENV.js from all NEXT_PUBLIC_* container env vars before supervisord starts, as defense-in-depth

Root cause

The supervisord environment directive for the web program was re-declaring NEXT_PUBLIC_HELICONE_JAWN_SERVICE using %(ENV_...)s interpolation. This overrode the value inherited from the Docker container environment, preventing docker-compose environment overrides from reaching the Next.js process. Other NEXT_PUBLIC_* vars (like NEXT_PUBLIC_APP_URL) worked correctly because they were NOT re-declared in the supervisord directive — they were simply inherited from the container env.

Files changed

File Change
supervisord.conf Remove redundant %(ENV_...)s vars from web and jawn environment directives
Dockerfile Add entrypoint script to generate __ENV.js before services start
docker-entrypoint.sh New entrypoint that reads all NEXT_PUBLIC_* env vars and writes public/__ENV.js

Test plan

  • Build Docker image: docker build -t helicone-test .
  • Run with custom NEXT_PUBLIC_HELICONE_JAWN_SERVICE:
    docker run -e NEXT_PUBLIC_HELICONE_JAWN_SERVICE=https://custom-jawn.example.com -p 3000:3000 helicone-test
    
  • Verify curl http://localhost:3000/__ENV.js contains https://custom-jawn.example.com
  • Verify frontend API calls go to the custom URL, not http://localhost:8585
  • Verify default behavior still works without docker-compose overrides

Closes #5551

…into env.js

The supervisord environment directive was re-declaring env vars like
NEXT_PUBLIC_HELICONE_JAWN_SERVICE and BETTER_AUTH_SECRET using %(ENV_...)s
interpolation. This could override docker-compose values with Dockerfile
defaults, preventing user-configured URLs from reaching the frontend.

Fix:
- Remove %(ENV_...)s re-declarations from supervisord.conf for both
  web and jawn programs — these vars are already set in the Dockerfile
  and are automatically inherited by child processes
- Add docker-entrypoint.sh that generates __ENV.js from the container's
  actual NEXT_PUBLIC_* env vars before supervisord starts

Closes Helicone#5551
@vercel
Copy link

vercel bot commented Feb 28, 2026

@shouryamaanjain is attempting to deploy a commit to the Helicone Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: NEXT_PUBLIC_HELICONE_JAWN_SERVICE is not passed from docker-compose into env.js in self-hosted Helicone

1 participant