Below is my entrypoint.ps1 (PowerShell-script):
Set-Location -Path C:\nginx
& "C:\nginx\Configure-Nginx.ps1"
& "C:\nginx\nginx.exe"
I need to my Configure-Nginx.ps1 and node.exe were executed on docker run so I've put an entrypoint to my Dockerfile:
FROM nginx
# nginx is a custom image that's based on mcr.microsoft.com/windows/servercore:1809-KB5003171
COPY entrypoint.ps1 ./
COPY install/Configure-Nginx.ps1 /nginx/Configure-Nginx.ps1
ENTRYPOINT ["powershell", "entrypoint.ps1"]
However my container begins to restart each minute... Well, I've decided there is a some error in the script then I run this image manually with --entrypoint powershell and executed my script in the console directly: .\entrypoint.ps1. The script was frozen (cuz nginx was launched) and I could connect to my container from web-browser on the host machine... So everything works! Then why doesn't it work if I call my entrypoint from Dockerfile? What's difference? Maybe someone has met a similar problem...
P.S. The container is based on mcr.microsoft.com/windows/servercore:1809-KB5003171 with PowerShell v5.1.17763.1852
docker logs <containerName>maybe that could be helpful.Dockerfile.docker logs? Maybe add someechoin your scripts to make sure they are being run. Then you can see the output withdocker logsor by running in attached mode. At least you can see if that's a problem with script or docker. I am also curious, do you HAVE TO use Windows? If you have the chance, run to Linux I don't have a choice, and I can guarantee this is only the beginning of your problems