Creating databases for Preview Deployments #4313
Unanswered
jamescrosswell
asked this question in
Q&A
Replies: 2 comments 1 reply
|
Probably the only way is to do it with neon branches. Currently looks like no way for this. Let's see, next version should have pre/after-deploy hook scripts. That could be a solution |
0 replies
|
Did you ever figure out a solution to this? I'm looking to use neon previews and dokploy previews together. Seems like using a Github workflow to create the neon preview database is the way to go as they provide easy actions for this. I don't know how to integrate this into dokploy to get it the neon database URL as it seems like it just only can create the preview environments when it detects a PR was made. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The app I'm deploying has some databases so I'm wondering how to do this. Ideally I could:
Are any of those things possible at the moment? If not, how are other folks doing this, as I imagine it's a pretty common problem to solve?
The only thing I can think is that I could potentially use hooks from my CI/CD (GitHub Actions) to create and delete some temporary databases when PRs get created/closed, based on the PR number or branch name... and then the from Dokploy I'd just need some way to infer the PR or branch that triggered the deployment and be able to use that in the environment variables for the preview deployment (which is where the db settings reside).
EDIT: Another thought is maybe using Docker Compose and just create the DB in a container with no persistent storage... which takes care of cleanup. I think I'll play around with that idea - so have the DB as a separate service in production, but create a 'Preview' app using Compose to test stuff out in PRs/branches.
EDIT 2: Hm... not as easy as I thought. Compose services don't have
Preview Deploymentslike Application services do 😢Back to square one then. How are folks doing this?
All reactions