How to deal with automatic capistrano symlinks and docker volumes

I’m looking for a way to work with docker and capistrano by changing less things in my deployment tasks as I can.

before, I ran the cap production deploy command and it connected to ssh, git cloned my project, created all symlinks for my shared folders between releases and executed my custom tasks.

  • Docker, How to replace capistrano tasks in docker
  • Running and Deploying Rails to Docker Container
  • docker-compose : Issue with .env path
  • How to use Capistrano with Rails and Docker-compose?
  • How to integrate Capistrano with Docker for deployment?
  • Updating a Symfony app with Docker-compose without losing data
  • The automatic symlinks were looking like that and depended each time on the deploy_to path:

    ln -s /home/railsproject/releases/20150105144249 /home/railsproject/current
    ln -s /home/railsproject/shared/public/uploads /home/railsproject/current/public/uploads

    Now, I’ll use a docker volume so files will be in different folders in my docker host but will always be in the same folder on different docker containers:

    ln -s /var/www/releases/20150105144249 /home/railsproject/current
    ln -s /var/www/shared/public/uploads /home/railsproject/current/public/uploads

    How can I override the way capistrano is making its symbolic links so I’ll always use my base folder /var/www/ to create symlinks even if capistrano will publish to /home/railsproject folder ?

    Maybe do you have a better way to create those symlinks or simply something else in mind ?

  • How to create a new docker image from a running container on Amazon?
  • Unable to push docker image to amazon ECR
  • folder permissions docker-osx-dev
  • Why I can't find ip_vs module or use ipvsadm when I add privileged
  • Jenkins: running docker commands on a docker slave
  • Kubernetes master is OK yet minions not working
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.