-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker on windows
- Loading branch information
Showing
6 changed files
with
205 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
FROM node:10 AS react-build | ||
RUN mkdir app | ||
COPY . /app/ | ||
COPY ./ /app | ||
WORKDIR /app | ||
RUN node openimis-config.js | ||
RUN . ./modules-installs.txt | ||
RUN yarn install --network-timeout 1000000 | ||
RUN yarn build | ||
RUN yarn global add serve | ||
RUN yarn global add serve | ||
CMD ["serve","-s","build"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
ARG INSTALL_BASE="mcr.microsoft.com/windows/servercore" | ||
ARG INSTALL_TAG="ltsc2016" | ||
ARG WINDOWS_VERSION="4.8-windowsservercore-ltsc2016" | ||
ARG WINDOWS_BASE="mcr.microsoft.com/dotnet/framework/aspnet" | ||
|
||
#FROM "${INSTALL_BASE}:${INSTALL_TAG}" AS downloader | ||
#ARG NEW_OPENIMIS_HOST | ||
#ENV NPM_CONFIG_LOGLEVEL info | ||
#ARG NODE_VERSION="10.16.3" | ||
#ARG ARCH="64" | ||
|
||
|
||
#SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
#WORKDIR C:/dl | ||
#ARG NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-x${ARCH}.msi" | ||
|
||
## download node and build the front end | ||
#RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;\ | ||
# Invoke-WebRequest -Uri $Env:NODE_URL -OutFile nodejs.msi -UseBasicParsing;\ | ||
# Start-Process msiexec.exe -Wait -ArgumentList '/q /i nodejs.msi'; | ||
#RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;\ | ||
# Invoke-WebRequest -Uri https://classic.yarnpkg.com/latest.msi -OutFile yarn.msi -UseBasicParsing;\ | ||
# Start-Process msiexec.exe -Wait -ArgumentList '/q /i yarn.msi'; | ||
|
||
#COPY ./ C:/app | ||
|
||
#WORKDIR C:/app | ||
#RUN node openimis-config.js | ||
#RUN ./modules-installs.txt; | ||
#RUN yarn install --network-timeout 1000000 | ||
#RUN yarn build | ||
|
||
|
||
|
||
FROM "${WINDOWS_BASE}:${WINDOWS_VERSION}" | ||
ARG OPENIMIS_VERSION="1.4.1" | ||
LABEL vendor="openIMIS"\ | ||
maintainer="Patrick Delcroix <[email protected]>"\ | ||
org.openimis.webapp.is-beta= \ | ||
org.openimis.webapp.is-production="" \ | ||
org.openimis.webapp.version="${OPENIMIS_VERSION}" | ||
ADD https://github.com/openimis/web_app_vb/releases/download/v${OPENIMIS_VERSION}/openIMIS_Web_App_x64_v${OPENIMIS_VERSION}.zip /temp/openIMIS.zip | ||
ADD "https://github.com/openimis/web_service_vb/releases/download/v1.2.1/openIMIS_Web_Services_v1.2.1.zip" /temp/Service.zip | ||
# ADD "https://github.com/openimis/policy_renewal_service_vb/releases/download/v1.2.0/ImisPolicyRenewalSetup.zip" /temp/Renewal.zip | ||
# ADD "https://github.com/openimis/assign_photo_service_vb/releases/download/v1.2.0/AssignPhotosSetup.zip" /temp/photo.zip | ||
# ADD "https://github.com/openimis/feedback_prompt_service_vb/releases/download/v1.2.0/ImisFeedbackPromptSetup.zip" /temp/feedback.zip | ||
ADD "https://github.com/shibayan/iislua/releases/download/v0.6.1/iislua_x64.msi" /temp/iislua_x64.msi | ||
ADD "https://go.microsoft.com/fwlink/?LinkID=615136" /temp/ARS.mis | ||
COPY script/configureConnectionStr.ps1 /temp/configureConnectionStr.ps1 | ||
COPY script/InstallopenIMIS.ps1 /temp/InstallopenIMIS.ps1 | ||
RUN powershell -Command /temp/InstallopenIMIS.ps1 $env:username;\ | ||
Start-Process msiexec.exe -Wait -ArgumentList '/q /i /temp/iislua_x64.msi'; | ||
RUN Start-Process msiexec.exe -Wait -ArgumentList '/q /i /temp/ars.msi'; | ||
#ADD https://github.com/openimis/openimis-fe_js/releases/download/v1.1.0/openIMIS_FE_v1.1.0.zip C:/temp/build.zip | ||
#RUN Expand-Archive -Path C:/temp/build.zip -DestinationPath C:/inetpub/wwwroot/openIMIS/front | ||
|
||
WORKDIR "/inetpub/wwwroot" | ||
#COPY --from=downloader /app/build /inetpub/wwwroot/openIMIS/front | ||
|
||
ENTRYPOINT ["powershell","-Command","C:\\temp\\configureConnectionStr.ps1"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#https://blog.backslasher.net/event-log-permissions-with-scripts.html | ||
param( | ||
[string]$IISUser = 'IIS_IUSRS', | ||
[string]$source='IMIS', | ||
[string]$LogName="$source-LOG", | ||
[string]$SiteName = "Default Web Site", | ||
[string]$PathZip = "/temp" | ||
) | ||
#configure ISS | ||
Import-Module WebAdministration | ||
|
||
$ZipFiles = Get-ChildItem "$PathZip/" -Filter *.zip | ||
Write-Output "move app binaries in wwwroot" | ||
|
||
if(Test-Path IIS:\Sites\$SiteName){ | ||
Write-output "Site $Sitename exist" | ||
} else{ | ||
Write-output "Site $Sitename doesn't exist, create it" | ||
New-WebSite -Name $Sitename -IPAddress -PhysicalPath /inetpub/wwwroot/ | ||
} | ||
foreach($Zip in $ZipFiles){ | ||
$ZipName = $Zip.BaseName | ||
New-Item -ItemType directory -Path /temp/$ZipName | ||
Expand-Archive $PathZip/$Zip -DestinationPath /temp/$ZipName/ | ||
$singleFile = (Get-ChildItem /temp/$ZipName/ | Measure-Object).count | ||
$subdirectoryPath = "" | ||
Write-output " number of file found $singleFile" | ||
if($singleFile -eq 1){ | ||
$subdirectoryPath = Get-ChildItem -Directory /temp/$ZipName/ -Name | Select-Object -First 1 | ||
Write-Output "sub directory $subdirectoryPath detected " | ||
$subdirectoryPath = "/$subdirectoryPath" | ||
} | ||
if($ZipName -eq "openIMIS"){ | ||
New-Item -ItemType directory -Path /inetpub/wwwroot/$ZipName | ||
Set-ItemProperty "IIS:\Sites\$SiteName\" -name physicalPath -value C:\inetpub\wwwroot\$ZipName | ||
Move-Item -Path "/temp/$ZipName$subdirectoryPath/*" -Destination "/inetpub/wwwroot/$ZipName/" | ||
Write-Output "Create a copy of the $ZipName config files" | ||
Copy-Item "/inetpub/wwwroot/$ZipName/Web.config" -Destination "/inetpub/wwwroot/$ZipName/Web.config.sample" | ||
}elseif(Test-Path "/temp/$ZipName$subdirectoryPath/Web.config"){ | ||
New-Item -ItemType directory -Path /inetpub/wwwroot/$ZipName | ||
New-WebApplication -Name $ZipName -Site $SiteName -PhysicalPath C:\inetpub\wwwroot\$ZipName -ApplicationPool DefaultAppPool | ||
Move-Item -Path "/temp/$ZipName$subdirectoryPath/*" -Destination "/inetpub/wwwroot/$ZipName/" | ||
Write-Output "Create a copy of the $ZipName config files" | ||
Copy-Item "/inetpub/wwwroot/$ZipName/Web.config" -Destination "/inetpub/wwwroot/$ZipName/Web.config.sample" | ||
}else{ | ||
Write-Output "Move $ZipName in the service directory" | ||
New-Item -ItemType directory -Path /service/$ZipName | ||
Move-Item -Path "/temp/$ZipName$subdirectoryPath/*" -Destination /service/$ZipName/ | ||
} | ||
|
||
} | ||
|
||
Write-Output "Create the eventlog/source" | ||
New-EventLog -LogName $LogName -Source $source | ||
Write-Output "give the right to $IISUser to the eventlog" | ||
$LogPath = 'HKLM:\SYSTEM\CurrentControlSet\services\EventLog\'+$LogName; | ||
$acl = Get-Acl $LogPath | ||
$ace = New-Object System.Security.AccessControl.RegistryAccessRule $IISUser,'WriteKey, ReadKey','allow' | ||
$acl.AddAccessRule($ace) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
param( | ||
[string]$DB_HOSTNAME=$Env:DB_HOST, | ||
[string]$DB_NAME=$Env:DB_NAME, | ||
[string]$DB_USER=$Env:DB_USER, | ||
[string]$DB_PASSWORD=$Env:DB_PASS | ||
) | ||
|
||
Write-Output 'Old config: ' | ||
Write-Output 'Source=[DatabaseIPAdress];Initial Catalog=IMIS;User ID=[ImisUserId];Password=[ImisUserPassword]' | ||
Write-Output 'New config: ' | ||
Write-Output "Source=$DB_HOSTNAME;Initial Catalog=$DB_NAME;User ID=$DB_USER;Password=$DB_PASSWORD" | ||
$WebDirectories = Get-ChildItem -Directory /inetpub/wwwroot/ | ||
foreach($webRoot in $WebDirectories){ | ||
$webRootName = $webRoot.Name | ||
Write-Output "write the $webRootName config files" | ||
if (Test-Path /inetpub/wwwroot/$webRootName/Web.config){ | ||
(Get-Content /inetpub/wwwroot/$webRootName/Web.config.sample)` | ||
-replace '\[DatabaseIPAdress\]',$DB_HOSTNAME` | ||
-replace '\[ImisUserId\]',$DB_USER` | ||
-replace '\[IMISDB\]',$DB_NAME` | ||
-replace '\[ImisUserPassword\]',$DB_PASSWORD` | ||
| Out-File -Encoding UTF8 /inetpub/wwwroot/$webRootName/Web.config;` | ||
Write-Output ('Pointing to legacy openIMIS on https://'+$Env:LEGACY_OPENIMIS_HOST) | ||
} | ||
} | ||
|
||
Write-Output "launch IIS" | ||
$ISSprocess = (Start-Process C:\ServiceMonitor.exe -ArgumentList 'w3svc' -PassThru ) | ||
$handle = $proc.Handle | ||
$ISSprocess.WaitForExit(); | ||
While ($true){ | ||
Get-EventLog -LogName IMIS-LOG -Source IMIS -After (Get-Date).AddMinutes(-1) | Sort-Object Time | ||
if ($ISSprocess.ExitCode -ne 0) { | ||
Write-Warning "$_ exited with status code $($proc.ExitCode)" | ||
break; | ||
} | ||
Start-Sleep -s 60 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
param( | ||
[string]$PathZip = "/temp" | ||
) | ||
|
||
#setting https protocols | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
# lattest open IMIS binaries | ||
$urlWebApp = "https://github.com/openimis/web_app_vb/releases/download/v1.3.0/openIMIS_Web_App_x64_v1.3.0.zip" | ||
$urlWebService = "https://github.com/openimis/web_service_vb/releases/download/v1.2.1/openIMIS_Web_Services_v1.2.1.zip" | ||
# $urlRenewalService = "https://github.com/openimis/policy_renewal_service_vb/releases/download/v1.2.0/ImisPolicyRenewalSetup.zip" | ||
#$urlBackupService = "https://github.com/openimis/backup_service_vb/releases/download/v1.2.0/ImisBackupSetupx64.zip" | ||
# $urlPhotoService = "https://github.com/openimis/assign_photo_service_vb/releases/download/v1.2.0/AssignPhotosSetup.zip" | ||
# $urlfeedbackService = "https://github.com/openimis/feedback_prompt_service_vb/releases/download/v1.2.0/ImisFeedbackPromptSetup.zip" | ||
#dowload | ||
Write-Output "download OpenIMIS binaries" | ||
Invoke-WebRequest -Uri $urlWebApp -OutFile "$PathZip/openIMIS.zip" | ||
Write-Output "download web services binaries" | ||
Invoke-WebRequest -Uri $urlWebService -OutFile "$PathZip/Service.zip" | ||
Write-Output "download Renewal service binaries" | ||
# Invoke-WebRequest -Uri $urlRenewalService -OutFile "$PathZip/RenewalService.zip" | ||
#Write-Output "download Backup service binaries" | ||
#Invoke-WebRequest -Uri $urlBackupService -OutFile "$PathZip/BackupService.zip" | ||
# Write-Output "download Photo update service binaries" | ||
# Invoke-WebRequest -Uri $urlPhotoService -OutFile "$PathZip/PhotoService.zip" | ||
# Write-Output "download Feedback prompt binaries" | ||
# Invoke-WebRequest -Uri $urlfeedbackService -OutFile "$PathZip/FBService.zip" | ||
# Write-Output "uncompress app binaries" |