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.

  • Updating a Symfony app with Docker-compose without losing data
  • How to integrate Capistrano with Docker for deployment?
  • How to deploy using capistrano without current release symlink?
  • How to use Capistrano with Rails and Docker-compose?
  • Running and Deploying Rails to Docker Container
  • Gitlab-ci configure docker runner for deployment with SSH keys
  • 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 connect to a Bitcoin testnet running in a docker container
  • mongoDB multiple instances or multiple databases
  • Cron is unable to run my command, even though it works for me (inside docker container)
  • Random container names when building from the same docker-compose file
  • getting “cannot find package” trying to build my application in a docker container
  • Control a container from another one
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.