[Kamal 2]: Container Conflicts for Staging and Production Application Running on Same Host #1110
Unanswered
mike-weiner
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Are you using same |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got a basic web application running on a DigitalOcean Droplet. I have both the production and staging instances of the application on the same host. I realize that's atypical. It's a non-critical, side project that I don't need redundancy for nor do I need to add complexity for 2 different hosts.
I'm hitting a weird edge case that I'm looking for some advice on.
When I've got a new build ready to go out to staging, I do a
kamal deploy -d staging
and it builds the container with the current commit (let's say that is123
), builds the image, and exposes portabcd
for my web application. That deploys perfectly.24 hours later I'll do a
kamal deploy
to push the changes out to production. Kamal re-builds the container with the same commit (123
) but it exposes a different port, let's sayefgh
for production. That process then overwrites that image in my registry with a build that now exposes portefgh
instead ofabcd
.The production instance deploys fine, but if I ever need to restart the staging instance, it will go and re-pull the
123
container image which is now built to expose the incorrect port.Is there a better way to achieve this kind of setup to avoid this? Or is this a limitation that I'm going to need to live with?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions