Deploy custom image tag
What problem will this feature address?
Usually in our deployment flow, we tend to build a Docker image on our Github Actions CI, to then push it into the Staging / Production servers, that will download the image and serve it in the containers directly, however, this is not possible with DokPloy to directly set it up, so we are "forced" to have in-server builds of the Dockerfiles, the problem with that is that we have 4 containers per environment that use the exact same image, which means that in each deployment we will have the same image built 4 times per environment (8 times in total, because we have 2 environments), while with the original workflow we could just build it one time and just pull it.
Describe the solution you'd like
Somehow allow the possibility to push the image tag that we want to deploy, this way it can just pull it for all the containers. Either support it with the webhook or the API call to do a new deployment, I wouldn't care really as long as we have a way of doing so.
Describe alternatives you've considered
So the workaround I did is to create a Custom Github Action that will update the Docker Provider on every app and deploying every one of those individually, this will cause the deployments to queue, and the first one in queue will download the image, while the others will use it locally as it's already downloaded by the first one.
This works fine, but I'm wondering if it would be best to have this logic internally. I'm willing to publish my Github Action publicly so it can be used by other users if needed, I don't have an issue with that, so I guess we could all use this workaround with Github
Additional context
For context, I used to use Caprover and they have their Github Actions in which you can configure the image you want to deploy, like so:
- name: Deploy Image to Staging CapRover
uses: caprover/[email protected]
with:
server: "${{ vars.CAPROVER_SERVER }}"
app: "${{ vars.APP_NAME }}"
token: "${{ secrets.APP_TOKEN }}"
image: ${{ needs.build.outputs.image_url }} # Here
Also, for some more context on how I deal with the API, here's a little Postman Flow that I have for manual deployments, I use it for rollbacks mainly, because I would have to go through the applications one by one to do those changes:
Will you send a PR to implement it?
No, but I can publish my Github Action
I had updated this issue, because I first had added an issue that I detected, but it had nothing to do with the deployment per-se, it was a configuration error that prevented DokPloy from deploying my containers (Basically I referenced unexisting project environment variables), and I had to access DokPloy's logs to get the error message. With this correction done, all the deployment works great
It's important issue
hey @DrakkoFire I was facing a similar issue, I found a way to do it via the Dokploy API
if you want, you can check out how I have imlpemented it in my action
https://github.com/jegork/dokploy-update-image-action/tree/release/0.1.0
Yeah +1 need support use webhook deploy customize image. Using token put it in enviroment for dev deploy really dangerous. Becuase with token anyone can see another product include change setting, change deployment, change enviroment vars.