Can I use a project wide environmental variable for domain?

I've multiple apps in my project and they use subdomains from a single domain, is it possible to set a project env and use that env value while adding domains to individual apps?
10 Replies
Henrik
Henrik3mo ago
No
randomabc12.
randomabc12.OP3mo ago
so if I want to change my domain, I'll have to do it for each app? also where are the project env stored? I can't find them anywhere in my dokploy directory
Henrik
Henrik3mo ago
In the database You can use env variables, but you have to write out the labels manually on each compose. I.e. you can't use the domain tab
randomabc12.
randomabc12.OP3mo ago
Cool, I'll try this. Thanks also what is the easiest way tk migrate dokploy to some other system. Earlier I was using docker-composes and on the new system i just copied them and ran them, can i do this plug n play with dokploy?
Henrik
Henrik3mo ago
Migrate compose -> dokploy or dokploy -> dokploy? You said both
randomabc12.
randomabc12.OP3mo ago
dokploy to dokploy
Henrik
Henrik3mo ago
There is no built in solution for that. You would have to manually copy what you need over.
randomabc12.
randomabc12.OP3mo ago
okay, so i will have to setup each app like i did earlier?
Henrik
Henrik3mo ago
Yup. Volumes has to be moved manually over
randomabc12.
randomabc12.OP3mo ago
follow up on this >You can use env variables, but you have to write out the labels manually on each compose. I.e. you can't use the domain tab I'm having some trouble to use project env. I added a project env using the ui "ABCD=localhost" now in one of my docker compose under service.environment, i wrote ABCD=${{ABCD}} this throws invalid interpolation format if I use ABCD=${ABCD} it throws no vaue set for ABCD (which i think is thr expected behaviour). So how exactly do i use project ENV, in a service? I've tried ${{project.ABCD}} as well got it working, i was putting this in the wrong place

Did you find this page helpful?