Getting kamal up and running

mitchell mitchell posted on 2024-11-05 19:56:15 UTC

Hi guys,

Watching the recent kamal videos I decided to try to convert an existing app to kamal. I want to do this nicely, so keeping all configuration inside deploy.yml

I just can't figure out the last part. I have a vpn accessory which when booted connects to a vpn server. 
This accessory then needs to 'share' his vpn network with the rails app (so the app can connect to the other vpn clients). I managed to get this to work adding:

network: container:name=<docker container name>

However this rails container name changes after every deploy. So I need to update the accessory network all time to keep connection...

Is there some way to reference the rails container so the accessory keeps sharing his connection after a deploy with the rails app? Docker expects an ID or a container NAME, which both change every deploy unfortunately...

Update:
I for now fixed the issue, I could net get it to work clean with just adding a accessory. In the end I made a post-deploy kamal hook which remove and makes a new docker container containing the VPN, and points it to the updated rails app. Hopefully in the future there will be a nicer way to do this.



Login to Comment
Back to forums