-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Error Message and Logs
I just want to bring to your attention the missing documentation or the confusion between a project environment, a resource's production and preview environment variables.
I only set the environment variables under the preview deployment environment variables fields; I was deploying an app in / as preview.
However, my application / node.js process would not access my environment variables, and the container of my app would constantly restart because it would fail the health-check.
After long hours of debugging, I realized that Coolify never pulled / set the environment variables that I defined under the preview deployment environment variables, but it would pull / set the environment variables when i defined them, upper, under the production environment variables.
Then, they were accessible in my node.js application (through process.env.VARIABLE_NAME).
I originally thought that the preview environment variables section was my thing since this was how I name the environment I was working on for this project.
So in order to prevent someone else experiencing the same confusion / issue, I am bringing this to your attention.
Please reference the recorded video for visual explanation / extra clarification:
blured_520859039-d61764fd-0682-4ac0-b478-89d3047f9eb7_blurred.mp4
Thank you !
Steps to Reproduce
- Create a project
- Create an new environment name
previewfor this project - Create a new application / resource, in my case a NODE.JS API, and that read an environment variable during runtime
- Define this environment variable under
Deployment preview environment variables - Deploy this application
- It would not be able to reference any environment variable under the
previewenvironment.
Example Repository URL
No response
Coolify Version
v4.0.0-beta.451
Are you using Coolify Cloud?
No (self-hosted)
Operating System and Version (self-hosted)
No response
Additional Information
No response