Replies: 1 comment 5 replies
-
@QarthO why are you trying to mount your repo into a container, ideally you copy the files you need during build, so they are in the container to begin with. that way no matter the pr, the new container will have the current files it needs post your dockerfile to see what you are missing |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm struggling to understand how to use a git source to also pull the files.
I currently have my git source linked. If i update the repo on the main branch, it automatically triggers a redeploy. Thats great! Amazing.If i make a pr, to the main branch, it's automatically making a preview deployment... wow! Just like vercel! Wait... these deployments don't change anything... they're all the same even though I PR'd an entire site redesign... ah coolify only updates docker-compose file. All of your other files that are changing don't do anything. None of these files are carried over to the existing docker volume.
There's an option to "preserve the repo during deployment" but this isnt helpful because the site's files are not in the volume. Ok so am I supposed to move these files over to the docker volume? Ok so now that gets a lot more complicated. I have to manually run a command before i boot up the container... but I won't be able to abstract the docker volume name because that could change on the wim depending on coolify appended container id or if its inside a preview deployment. Ok so now do I need to run it after while inside the container? Ok now how do I get access to the repo files? Oh great, now I have to create a mount volume that pulls in the repo files, move them over. Well now I also have to update the permissions so the docker image can actually read/write to those files. This seems to work, but adds so many layers of complexity. And doesn't work for preview deployments (#5084)
Alternatively I could setup a pipeline on github to push the files in, but that opens an entire new can of worms having to figure out what container it needs to go, what volumes. And yeah, good luck getting this working on preview deployments.
I've also just tried mounting a volume thats just the deployment directory. And that seemed to have worked, except I couldn't for the life of me figure out how to give container proper permissions to have write access those files. I was only able to do such by manually chmod in the terminal as the root user on the server (not thru the container) And it would work... unless the container created a file, (ie. a tmp or cache file). I tried separating all files needing to be written to its own volume... and that didn't work. I thought I'd just manually have to chmod every file, but I'd have to do it on every redeploy. Which seemed really messy, and I thought i finally got it to work.... then enter preview deployments. These apparently override these files compeltely. So now my "live" site's files are now the PR's files... great. So this isnt the way to do it.
My end goal, is if I go in and update an html file and push it to the repo thats linked, that coolify will see that and update the site. Exactly how vercel does it. But thats just not the case. I have to do all this tom foolery, that is infinitely more complex, and in the end just doesnt work.
Am I missing something obvious? Am I just going about this all wrong? Is there some "magical" checkbox im missing.
Please help me figure out how to do this.
And I would really appreciate if how to do this was documented somewhere, so others don't spiral down this hellhole like i have. I feel like this entire coolify project is supposed to be the really easy, and simple self-hostable vercel but well... unfortunately that's not the case
Beta Was this translation helpful? Give feedback.
All reactions