port number not change for docker-compose
<p>I have specified port-mapping in docker-compose, but it is still not working, i still have to access site using the port no specified in expose</p>

<p>below is my <code>docker-compose.yml</code></p>

<pre><code>version: '2'

networks:
  default:
    external:
      name: nat

services:

    website:
        build:
            context: '.'
            dockerfile: "./iis.dockerfile"
        ports:
            - 3000:8081
</code></pre>

<p>and the corrosponding <code>dockerfile</code></p>

<pre><code>FROM microsoft/iis

RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]

ADD www/ c:\\webapp

EXPOSE 8081

RUN powershell New-Website -Name 'web-app' -Port 8081 -PhysicalPath 'c:\webapp' -ApplicationPool '.NET v4.5'
</code></pre>

<p>I have to access app using: <code>http://192.168.105.33:8081/</code>, if I do it using port 3000 it does not work.</p>

<p>Is there anything missing in my above configuration?? OS: <code>windows server 2016</code>, using windows containers with <code>hyper-v</code> and <code>docker-compose up -d</code> to get containers up and running...</p>

<p>docker-compose inspect gives me below output</p>

<pre><code> "Ports": {
     "8081/tcp": [
         {
             "HostIp": "0.0.0.0",
             "HostPort": "3000"
         }
     ]
 },
</code></pre>

<p><code>docker ps</code> gives me below output</p>

<pre><code>  eb7aa1e74b7f        website_website     "C:\\ServiceMonitor..."   14 minutes ago      Up 14 minutes       0.0.0.0:3000-&gt;
</code></pre>

<p>8081/tcp   website_website_1</p>

<p><code>dokcer-compose ps</code> gives me below output</p>

<pre><code>  Name                    Command             State           Ports
  --------------------------------------------------------------------------------
  website_website_1   C:\ServiceMonitor.exe w3svc   Up      0.0.0.0:3000-&gt;8081/tcp
</code></pre>

<p>So I should be able to access it on host using port 3000.</p>