title: Docker - Can't share data between containers within a volume (docker-compose 3)
body: <p>I have some containers for a web app for now (nginx, gunicorn, postgres and node to build static files from source and a React server side rendering). In a Dockerfile for the node container I have two steps: build and run (<a href="https://www.dropbox.com/s/f2l4f1rzhuxat7d/Dockerfile.node?dl=0" rel="noreferrer">Dockerfile.node</a>). It ends up with two directories inside a container: <code>bundle_client</code> - is a static for an nginx and <code>bundle_server</code> - it used in the node container itself to start an express server.</p>
  
  <p>Then I need to share a built static folder (<code>bundle_client</code>) with the nginx container. To do so according to docker-compose reference in my <code>docker-compose.yml</code> I have the following services (See full <a href="https://www.dropbox.com/s/aq8n8bug9jbhhwq/docker-compose.yml?dl=0" rel="noreferrer">docker-compose.yml</a>):</p>
  
  <pre><code>node:
    volumes:
      - vnode:/usr/src
  
  nginx:
    volumes:
      - vnode:/var/www/tg/static
    depends_on:
      - node
  </code></pre>
  
  <p>and volumes:</p>
  
  <pre><code>volumes:
    vnode:
  </code></pre>
  
  <p>Running <code>docker-compose build</code> completes with no errors. Running <code>docker-compose up</code> runs everyting ok and I can open <code>localhost:80</code> and there is nginx, gunicorn and node express SSR all working great and I can see a web page but all static files return 404 not found error.</p>
  
  <p>If I check volumes with <code>docker volume ls</code> I can see two newly created volumes named <code>tg_vnode</code> (that we consider here) and <code>tg_vdata</code> (see full docker-compose.yml)</p>
  
  <p>If I go into an nginx container with <code>docker run -ti -v /tmp:/tmp tg_node /bin/bash</code> I can't see my <code>www/tg/static</code> folder which should map my static files from the node volume. Also I tried to create an empty <code>/var/www/tg/static</code> folder with nginx container <code>Dockerfile.nginx</code> but it stays empty.</p>
  
  <p>If I map a <code>bundle_client</code> folder from the host machine in the <code>docker-compose.yml</code> in a <code>nginx.volumes</code> section as <code>- ./client/bundle_client:/var/www/tg/static</code> it works ok and I can see all the static files served with nginx in the browser.</p>
  
  <p>What I'm doing wrong and how to make my container to share built static content with the nginx container?</p>
  
  <p><strong>PS:</strong> I read all the docs, all the github issues and stackoverflow Q&amp;As and as I understood it has to work and there is no info what to do when is does not.</p>
  
  <p><strong>UPD:</strong> Result of <code>docker volume inspect vnode</code>:</p>
  
  <pre><code>[
  {
      "CreatedAt": "2018-05-18T12:24:38Z",
      "Driver": "local",
      "Labels": {
          "com.docker.compose.project": "tg",
          "com.docker.compose.version": "1.21.1",
          "com.docker.compose.volume": "vnode"
      },
      "Mountpoint": "/var/lib/docker/volumes/tg_vnode/_data",
      "Name": "tg_vnode",
      "Options": null,
      "Scope": "local"
  }
  ]
  </code></pre>
  
  <p>Files:
  <a href="https://www.dropbox.com/s/f2l4f1rzhuxat7d/Dockerfile.node?dl=0" rel="noreferrer">Dockerfile.node</a>,
  <a href="https://www.dropbox.com/s/aq8n8bug9jbhhwq/docker-compose.yml?dl=0" rel="noreferrer">docker-compose.yml</a></p>
  
  <p>Nginx dockerfile: <a href="https://www.dropbox.com/s/i5da41f4ejm0fya/Dockerfile.nginx?dl=0" rel="noreferrer">Dockerfile.nginx</a></p>
  
  <hr>
  
  <p><strong>UPD:</strong> I have created a simplified repo to reproduce a question: <a href="https://bitbucket.org/vashchukmaksim/docker-share-volume-test/src/master/" rel="noreferrer">repo</a>
  (there are some warnings on <code>npm install</code> nevermind it installs and builds ok). Eventually when we open <code>localhost:80</code> we see an empty page and 404 messages for static files (<code>vendor.js</code> and <code>app.js</code>) in Chrome dev tools but there should be a message <code>React app: static loaded</code> generated by react script.</p>