Hello,
I have containerized a Windows Communication Foundation (WCF) service with Docker and Traefik using Windows Containers. I am also using a container with whoami for testing.
However, no matter what I try, I am unable to access the WCF service using a URL.
If I browse to http://localhost/whoami, it works.
If I browse to the WCF service using the IP address (e.g. http://172.21.181.95/LBWWSDomain.svc), it works.
I thought that browsing to http://localhost/LBWWSDomain/LBWWSDomain.svc would work but instead I get a 404 error.http://localhost/LBWWSDomain.svc does not work either.
NOTE: I am running docker in a Windows 10 virtual machine. However, I guess this has no influence on this matter.
I've tried everything I could think of to no avail. I don't understand what I may be doing wrong. Any help would be appreciated.
Thank you.
My docker-compose.yml file:
version: '3.8'
services:
traefik:
# The latest official supported Traefik docker image.
image: traefik:v2.6.1-windowsservercore-1809
ports:
# Exposes port 80 for incomming web requests
- "80:80"
# The Web UI port <http://0.0.0.0:8080> (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events.
- .:C:/etc/traefik
- type: npipe
source: \\.\pipe\docker_engine
target: \\.\pipe\docker_engine
whoami:
# A container that exposes an API to show its IP address.
image: stefanscherer/whoami:windows-amd64-2.0.2
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Path(`/whoami`) || Path(`/whoami/`)"
- "traefik.http.routers.whoami.entrypoints=web"
# My WCF service.
lbwwsdomain:
image: lbwwsdomain:1.0.0-windows
labels:
- "traefik.enable=true"
- "traefik.http.routers.lbwwsdomain.rule=Path(`/lbwwsdomain`) || Path(`/lbwwsdomain/`)"
- "traefik.http.routers.lbwwsdomain.entrypoints=web"
My traefik.yml file:
api:
dashboard: true
insecure: true
providers:
docker:
exposedByDefault: false
swarmMode: false
endpoint: npipe:////./pipe/docker_engine
log:
level: INFO
entryPoints:
web:
address: ":80"