forked from estenrye/nginx-windowsservercore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
24 lines (21 loc) · 922 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM microsoft/windowsservercore:latest
MAINTAINER @csciborg
ARG NginxVersion=1.13.1
ENV NginxVersion $NginxVersion
ENV WriteReverseProxyConfFromEnv=true \
ReverseProxyListenPort=80 \
ReverseProxyServerName=nginx \
ReverseProxyLocationList=@() \
EnabledSitesPath=c:\\nginx\\enabled-sites \
EnableNginxWebServer=true \
NginxConfFile=c:\\nginx\\nginx-${NginxVersion}\\conf\\nginx.conf
EXPOSE ${ReverseProxyListenPort}
SHELL ["powershell", "-command"]
RUN Invoke-WebRequest "http://nginx.org/download/nginx-$($env:NginxVersion).zip" -OutFile C:\nginx.zip; \
Expand-Archive C:\nginx.zip C:\nginx ; \
Remove-Item "C:\nginx\nginx-$($env:NginxVersion)\conf\*.conf" -Verbose; \
New-Item -type directory "$($env:EnabledSitesPath)"; \
Remove-Item C:\nginx.zip;
WORKDIR /nginx/nginx-${NginxVersion}
COPY ./conf/* ./conf/
ENTRYPOINT .\conf\Generate-ReverseProxyConf.ps1;.\nginx.exe -c $env:NginxConfFile