-
Notifications
You must be signed in to change notification settings - Fork 109
/
Dockerfile
43 lines (32 loc) · 1.54 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# escape=`
FROM dockersamples/aspnet-monitoring-exporter AS exporter
FROM microsoft/aspnet:3.5-windowsservercore-ltsc2016
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
COPY ./share/WebFormsApp.zip .
RUN Expand-Archive -Path WebFormsApp.zip -DestinationPath C:\; `
Remove-Item WebFormsApp.zip
ENV APP_ROOT="C:\WebFormsApp" `
LOG4NET_CONFIG_PATH="" `
APPSETTINGS_CONFIG_PATH="" `
CONNECTIONSTRINGS_CONFIG_PATH="" `
DEPENDENCY_CHECK_ENABLED="" `
METRICS_COLLECTOR_ROOT="C:\aspnet-exporter" `
COLLECTOR_CONFIG_PATH="w3svc-collectors.json"
RUN Import-Module WebAdministration; `
Set-ItemProperty 'IIS:\AppPools\.NET v2.0' -Name processModel.identityType -Value LocalSystem; `
Remove-Website -Name 'Default Web Site'; `
New-Website -Name web-app -Port 80 -PhysicalPath $env:APP_ROOT -ApplicationPool '.NET v2.0'
VOLUME C:\logs
COPY .\docker\webforms-v5\startup.ps1 .
ENTRYPOINT ["powershell", "\\startup.ps1"]
COPY ./share/DependencyChecker.zip .
RUN Expand-Archive -Path DependencyChecker.zip -DestinationPath $env:APP_ROOT; `
Remove-Item DependencyChecker.zip
COPY ./share/HealthChecker.zip .
RUN Expand-Archive -Path HealthChecker.zip -DestinationPath $env:APP_ROOT; `
Remove-Item HealthChecker.zip; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';' + $env:APP_ROOT, [EnvironmentVariableTarget]::Machine)
HEALTHCHECK --interval=2s `
CMD ["HealthChecker.exe"]
COPY --from=exporter C:\aspnet-exporter ${METRICS_COLLECTOR_ROOT}
EXPOSE 50505