basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
10.6k stars 407 forks source link

Improvement request: add support for volumes-from for sharing data between docker containers #791

Closed KeithP closed 4 months ago

KeithP commented 5 months ago

Hi. We need the web container to have access to the letsencrypt certificate generated by traefik. In our case in order to perform server to server mTLS. The broader question is How To Share Data between Docker Containers using Kamal.

So on the web container we need to fix this: No such file or directory @ rb_sysopen - letsencrypt/acme.json

I'm fairly new to Kamal and Docker but the way forward seems to be via a volumes-from argument like this:

$ docker run -ti --name=Container6 --volumes-from Container4:ro ubuntu

Could Kamal be expanded to support volumes-from?

# deploy.yml

servers:
  web:
    ...
    volumes:    
      - "storage:/rails/storage" 
      from:
        - "traefik:ro"

or

# deploy.yml

servers:
  web:
    ...
    volumes:    
      - "storage:/rails/storage" 
    volumesFrom:
      - "traefik:ro"
dhh commented 4 months ago

We're tackling Let's Encrypt provisioning directly in Kamal 2. So won't be exploring this.