D
Dokploy3mo ago
Sr Izan

is there a way to reload environment variables without rebuilding

title
11 Replies
Henrik
Henrik3mo ago
Nope. They have to be rebuilt/redeployed. If you have a lengthy build process, you should build the image and push it to a registry instead. That makes it faster to switch to a new one
Sr Izan
Sr IzanOP3mo ago
thank you!
Vishal
Vishal3mo ago
might be possible if we use .env then you can stop and start your container. try if this works
env_file:
- .env
env_file:
- .env
Henrik
Henrik3mo ago
No it does not work. You have to do docker compose up command for that to take effect. Start and stop will not change the variable
Vishal
Vishal3mo ago
ok then i might be wrong
Henrik
Henrik3mo ago
I was a bit unsure about that case, so I just tested it But env file isn't something that would work with Dokploy? Where should we put it?
Vishal
Vishal3mo ago
I have see few templates using env_file for example plausible so i thought if thats added then there must be some usecase within dokploy you should put that in the raw compose
Henrik
Henrik3mo ago
You're absolutly rigth. I took a look at the source and indeed it builds a .env file. I didn't know that.
Henrik
Henrik3mo ago
That will be quite usefull for a few projects. Learn something new every day
Vishal
Vishal3mo ago
yeah, even i do explore and learning slowly

Did you find this page helpful?