title: Cloud Formation : Docker Swarm Mode on AWS
body: <p><strong>Question : How do you bind and access a volume in your docker-compose once you are inside Manager Instance created by Cloud Formation?</strong></p>
  
  <p>My Problem:</p>
  
  <ul>
  <li><p>My <strong>docker-compose.yml</strong> file is such that I need to bind an
  external Django Project Code with the services/containers which will
  be created by the stack but <strong>Cloud Formation</strong> functions on
  <strong>EBS(Elastic Block Store) and EFS(Elastic File System)</strong> and I don't know to use them to put my project in them and get them accessed by
  the stack.</p></li>
  <li><p>I have been practicing something on Docker Swarm since a week and now
  I want to deploy my docker-compose.yml on <strong>AWS</strong> using <strong>"Docker for
  AWS" Cloud Formation Stack Template.</strong></p></li>
  <li><p>I saw this tutorial and followed too but in my project, I am mainly
  facing issues when I have to bind volume.</p></li>
  <li><p>In Cloud Formation for <strong>Docker for AWS</strong> when you ssh the manager
  instance the syntax is like:
  <code>ssh -i [your-pem-key] docker@[manager-instance-public-ip]</code></p></li>
  <li><p>Now after getting into the manager what I did was I executed my docker-compose.yml in the same stack which was created early by Docker on AWS template by the syntax:</p>
  
  <p><code>docker stack deploy -c docker-compose.yml TestLab</code>    </p>
  
  <p>but as because my app needs code how to bind it with a volume.</p></li>
  <li><p>I would like to say that <code>-v</code> mounts don't work here.</p></li>
  </ul>
  
  <p>Links which I have already referred and discarded:</p>
  
  <ul>
  <li><a href="https://github.com/thecodeteam/labs/tree/master/setup-dockerforaws" rel="nofollow noreferrer">https://github.com/thecodeteam/labs/tree/master/setup-dockerforaws</a></li>
  <li><a href="https://blog.thecodeteam.com/2017/02/09/persistent-storage-docker-aws-not-a-mystery/" rel="nofollow noreferrer">https://blog.thecodeteam.com/2017/02/09/persistent-storage-docker-aws-not-a-mystery/</a></li>
  <li><a href="https://dzone.com/articles/docker-swarm-mode-on-aws" rel="nofollow noreferrer">https://dzone.com/articles/docker-swarm-mode-on-aws</a></li>
  </ul>
  
  <p>etc..</p>