Skip to content

Instantly share code, notes, and snippets.

@sebagomez
Last active February 8, 2019 15:43
Show Gist options
  • Save sebagomez/4d6e4486a8a78f8eaa5c89754abce202 to your computer and use it in GitHub Desktop.
Save sebagomez/4d6e4486a8a78f8eaa5c89754abce202 to your computer and use it in GitHub Desktop.
Windows Container dockerfile
# escape=`
FROM microsoft/dotnet-framework:4.7.2-runtime
LABEL MAINTAINER="Seba Gómez <sgomez@genexus.com>"
# GeneXus
COPY GeneXus/ c:/GeneXus
RUN C:/GeneXus/Genexus.com /install && `
powershell -Command "Copy-Item C:/Users/ContainerAdministrator/AppData/Roaming/GeneXus C:/Windows/SysWOW64/config/systemprofile/AppData/Roaming -Recurse"
COPY Artech.* c:/GeneXus/
# GeneXus M Service
COPY GXM_Services/ C:/GXM_Services
COPY LocalSettings.json C:/GXM_Services/GXM_Services/Services/Settings.json
# GeneXus Server
COPY GeneXusServer/ C:/GeneXusServer
#ENABLE IIS
RUN powershell -Command `
Add-WindowsFeature Web-Server; `
Add-WindowsFeature NET-Framework-45-ASPNET; `
Add-WindowsFeature Web-Asp-Net45; `
Add-WindowsFeature NET-WCF-TCP-Activation45; `
Add-WindowsFeature NET-WCF-HTTP-Activation45; `
Add-WindowsFeature Web-WebSockets; `
New-WebAppPool GeneXusServerAppPool; `
New-WebApplication -Name GeneXusServer -Site 'Default Web Site' -PhysicalPath C:\GeneXusServer\VDir -ApplicationPool GeneXusServerAppPool;
# Change AppPool properties
RUN C:\Windows\System32\inetsrv\appcmd.exe set app /app.name:"Default Web Site/" /enabledProtocols:"http,net.tcp" & `
C:\Windows\System32\inetsrv\appcmd set apppool /apppool.name:GeneXusServerAppPool /enable32BitAppOnWin64:true & `
C:\Windows\System32\inetsrv\appcmd set apppool /apppool.name:GeneXusServerAppPool /processModel.identityType:"LocalSystem" & `
C:\Windows\System32\inetsrv\appcmd set apppool /apppool.name:GeneXusServerAppPool /managedRuntimeVersion:"v4.0"
# Enable https
COPY tools/enable_https.ps1 C:/tools/
RUN powershell -File .\tools\enable_https.ps1
#Install Chocolatey
RUN powershell -Command Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install Microsoft Visual C++ Redistributable for Visual Studio 2017, URLRewrite Module and SQL Server CMD Utilities (BCP)
RUN choco install vcredist140 -y & `
choco install urlrewrite -y & `
choco install sqlserver-cmdlineutils -y
# Install the Java SDK and Tomcat 8
RUN choco install jdk8 -y & `
choco install tomcat -y -params "unzipLocation=C:\\Tomcat8"
# Set the needed Tomcat registry values
RUN powershell -Command `
New-Item -Path 'HKLM:\SOFTWARE' -Name 'Apache Software Foundation'; `
New-Item -Path 'HKLM:\SOFTWARE\Apache Software Foundation' -Name 'Tomcat'; `
New-Item -Path 'HKLM:\SOFTWARE\Apache Software Foundation\Tomcat' -Name '8.5'; `
New-Item -Path 'HKLM:\SOFTWARE\Apache Software Foundation\Tomcat\8.5' -Name 'Tomcat8'; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Apache Software Foundation\Tomcat\8.5\Tomcat8' -Name 'InstallPath' -Value 'c:\Tomcat8\apache-tomcat-8.5.12'
# Install GeneXus M Services
RUN powershell New-Service -Name GeneXusM -Description 'GeneXus M Services' -BinaryPathName C:\GXM_Services\GXM_Services\Services\GenexusServiceHost.exe -StartupType Automatic
# Install Tomcat as Windows Service (and set its StartType to Automatic)
RUN C:/Tomcat8/apache-tomcat-8.5.12/bin/service.bat install & `
powershell Set-Service -Name Tomcat8 -StartupType Automatic
# Install the Microsoft .NET Core SDK and Windows Server Hosting
RUN choco install dotnetcore-sdk -y & `
choco install dotnetcore-windowshosting -y
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
EXPOSE 80 80/udp 8001 8001/udp 8080
ENTRYPOINT ["powershell", "Get-Content", "C:\\GXM_Services\\GXM_Services\\GXMBLServices.log", "-Wait", "-Tail 1"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment