Search code examples
dockerdocker-composewindows-server-2019

On Windows Server '19 Can docker run side by side with IIS?


I built a project (react/express) and used Docker and docker-compose to stand up my local development environment. I'm ready to deploy now and I have a Windows Server 2019 VM that is currently hosting PHP applications on IIS.

Is it possible to add Docker to my server and host my containerized application without impacting my existing IIS sites (Essentially run the container and IIS side by side)? If so, how do I bind the container/application to a URL within IIS?

I have really struggled to find Docker information on this topic.

Also, while I'm at it, will I need to pay for Docker Enterprise Edition?


Solution

  • Yes, you can, IIS by default will use port 80 and 443. Hence, to make it run side-by-side:

    • When run your docker do not mapping to port 80. docker run -p 8080:80 your_docker_handler for example. Hence you can access you IIS using http://server-ip and for docker http://server-ip:8080

    or else,

    • You can do reverse proxy from IIS to your docker if you want to access docker without the port. But this one will need more effort and maybe some adjustment on your app code inside docker as well