title: Serving static files with nginx located in another docker container
body: <p>Just to start off, I have seen <a href="https://stackoverflow.com/questions/31798849/how-to-serve-static-files-with-nginx-inside-of-a-docker-container">this</a>. But he/she uses <code>build</code>, and I use <code>image</code>.</p>
  
  <p>I have a docker-compose file that pulls an image that I have made previously onto my server.  </p>
  
  <pre><code>app:
    restart: always
    image: some-app-image:latest
  </code></pre>
  
  <p>nginx config</p>
  
  <pre><code>location /static/ {
      root /data/app/web_interface;  &lt;--- this exists in some-app-image container
  }
  </code></pre>
  
  <p>Normally, I would have a volume mounted onto the app image that contains the static files.  </p>
  
  <p>However, this is becoming redundant since the app container has the static files in itself. </p>
  
  <p>All the nginx container needs to do is "peer" into the app container and serve those static files. Like:</p>
  
  <pre><code>location /static/ {
      root http://app:8000/web_interface;
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>location /static/ {
      root app/web_interface;
  }
  </code></pre>
  
  <p>Any chance there is a way to serve static files located in another container from a nginx container?</p>