dokploy
dokploy copied to clipboard
Feature: post/pre deployments commands
Hello guys, Thanks for the hard work!
Can we implement such a feature? it would be useful for database seeding or sending a webhook request after deployment.
image source: coolify
Hi , I think we will do something like this but now we have some features to finish.
Hi, Thanks!
Currently the command we provide is based solely on docker, however could you give me use cases for pre deployment and post deployment, I want to see how good an idea it would be to implement this
Hi, Thanks!
Currently the command we provide is based solely on docker, however could you give me use cases for pre deployment and post deployment, I want to see how good an idea it would be to implement this
I usually use them for seeding the database in dev/staging env, or for sending notifications (using webhooks) about the deployment life cycle.
example:
post deployment command: node seeder.js && node scripts/notify-slack.js --project backend
I understand that the post command should be run after the container is lifted, but in the case of the pre it would run a command in a container that does not exist yet.
I believe the way Coolify handles pre commands is to run them on the last deployment container, right before killing it. if there is no previous deployments, the pre command gets ignored. someone could correct me if im wrong here.
example of running pre command: ls
I think pre-deploy is a container for testing and when you deploy to production will kill testing container.
A related feature that could be useful a pre deploy action - backup db before deployment especially.
I think the post deployment, we have it just when it is initialized at the moment you can pass it in advanced tab -> command, for the pre deployment we can validate if the container exists and it is running execute the command
Regarding use cases:
As @bgervan says for pre deploy, backup db would be helpful.
For post deploy, I want to run a clear cache command.
I'd prefer not to add it to the docker image as I'd only like it to occur on deployment, not on container restarts.
This feature is very crucial. Please add.
Any updates on this?
Is there any workaround for now? We want deploy Dokploy in our infrastructure but this is show stopper for us. We need to run database migrations as soon as container is in running state after deployment and we don't want execute migration command for every container restart.
We need to run database migrations as soon as container is in running state ...
exact same for me here
+1 this is important for db migrations, the current workaround is use an external container builder / registry like GCP or Github Actions that will run a migration job after building but before deploy. The command doesn't necessarily have to be run in a container. For simplicity it could require the user to do "docker run ..." themselves.
+1
+1
+1