0

I am trying to run docker windows containers on 5 VM's using docker swarm and thses 5 machines are behind F5 loadbalancer. I was able to setup docker-swarm master and 5 nodes and successfully deployed the stack as well, but now the catch is on each node I have to copy respective web.config file inside container from node (web.config is avalable on every node).

I am now passing entrypoint.bat file which will copy file from mounted volume to resepctive website dir.

The defalut entrypoint is: ["c:\Servicemonitor" "w3svc"] Overridden entrypoint is (this is in batchfile): "c:\Servicemonitor" "w3svc" Code to copy file

After stack deploy, my container runs for ~6 seconds and the exists, I have checked the logs and verified that web.config file is getting copied properly but somehwo IIS/w3svc stops.

I am not sure by when we will have copy functionality using docker-stack.yml

Thank you in advance,

SAAM

Suhas
  • 49
  • 5

1 Answers1

0

I was able to produce workaround, powershell script mentioned below:

Start-Service w3svc     #make sure to start w3svc
$file="C:\cq\web.config"        # kept on bilnd mount volume
do { 
if (-not (Test-Path $file)) {
    Write-Host "Awaiting for file"
    Start-Sleep -s 5
}Else{
        Copy-Item -Path C:\web\web.config -Destination C:\inetpub\wwwroot\mysite
        Write-Host "File copied"
        IISRESET /status            # just to check status
        C:\servicemonitor.exe WAS   # I am aksing servmon to monitor WAS instead of w3svc and keep servmon active
    }

} until (Test-Path $file)

Suhas
  • 49
  • 5