title: Docker compose with nginx keeps displaying welcome page
body: <p>I'm new to <em>docker</em> and trying the simplest docker-compose.yml showing an hello world page to build on top of that with eventually a full <em>LEMP stack</em> that would have the same config as my server. However most tutorials are obsolete and there are so many ways of using <em>docker</em> that I can't find one using only <em>Docker compose</em> v3 that is still actual. I checked the docs and it's awfully confusing as well for a beginner, been trying to make it work for the past 5 hours so I thought I'd ask on SO.</p>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>version: '3'
  services:
    web:
      image: bitnami/nginx:1.10.3-r0 #using this version as it's the same on my server
      volumes:
        - "./test.conf:/etc/nginx/sites-available/test.local"
        - "./test.conf:/etc/nginx/sites-enabled/test.local"
        - "./code:/var/www/html" #code contains only a basic index.html file
      ports:
        - "80:80"
  </code></pre>
  
  <p><strong>test.conf</strong></p>
  
  <pre><code>server {
      listen 80;
      listen [::]:80;
      server_name test.local;
  
      index index.html; #Only a basic helloworld index.html file
      error_log  /var/log/nginx/error.log;
      access_log /var/log/nginx/access.log;
      root /var/www/html;
  }
  </code></pre>
  
  <p>Do I need a <em>Dockerfile</em> with this? Tutorials don't seem to mention it's needed.</p>
  
  <p><strong>NOTE:</strong><br>
  Tried adding the volume</p>
  
  <pre><code>- "./default.conf:/etc/nginx/conf.d/default.conf"
  </code></pre>
  
  <p>but nothing changes and the welcome page still loads, while with <em>nginx:latest</em> I get a very verbose error containing this phrase: "unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type".</p>
  
  <p><strong>UPDATE about docker-compose.yml:</strong>  </p>
  
  <ul>
  <li>Without the line <code>"./code:/usr/share/nginx/html"</code>, the <code>/usr/share/nginx/html</code> folder contains the default index.html file (expected)</li>
  <li>With the line <code>"./code:/usr/share/nginx/html"</code>, the <code>/usr/share/nginx/html</code> folder is <strong>EMPTY</strong>!</li>
  <li>With the line <code>"./:/usr/share/nginx/html"</code>, the <code>/usr/share/nginx/html</code> folder has and empty "code" folder and a bunch of random test files I deleted a while ago.</li>
  </ul>
  
  <p>Between tries, I run my reset script to make sure I start fresh:</p>
  
  <pre><code>docker rm $(docker ps -a -q)
  docker rmi $(docker images -q) --force
  docker volume rm $(docker volume ls -q)
  </code></pre>
  
  <p>Running <code>docker inspect &lt;container&gt;</code> returns this for the volume, not sure it's normal that the type is "bind" for as a <a href="https://docs.docker.com/storage/bind-mounts/" rel="noreferrer">bind mount</a> instead of a <a href="https://docs.docker.com/storage/volumes/" rel="noreferrer">volume</a>.</p>
  
  <pre><code>"Mounts": [
      {
          "Type": "bind",
          "Source": "/e/DEV/sandbox/docker",
          "Destination": "/usr/share/nginx/html",
          "Mode": "rw",
          "RW": true,
          "Propagation": "rprivate"
      }
  ],
  </code></pre>