Sign inSign up

ppanditrao/windows-php-sample-app

By ppanditrao

•Updated about 8 years ago

windows-php-sample-app

Image
0

1.2K

ppanditrao/windows-php-sample-app repository overview

docker run -d -p 8000:8000 --name php-app ppanditrao/windows-php-sample-app http://IP_address:8000/

⁠PHP 7.1 x64 running on IIS

FROM microsoft/iis AS php71

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

⁠Install PHP

RUN Invoke-WebRequest 'https://storage.googleapis.com/qa-files/php-config.zip⁠' -UserAgent '' -OutFile C:\php-config.zip;

RUN Expand-Archive -Path c:\php-config.zip -DestinationPath C:; RUN Expand-Archive -Path c:\php.zip -DestinationPath C:\php;

⁠Install PHP Win Cache

RUN C:\php_wincache.exe /Q /C "/T:C:\php_wincache_msi"; RUN Start-Process -FilePath msiexec -ArgumentList '/a C:\php_wincache_msi\wincache71x64wpi.msi /qb TARGETDIR=C:\php_wincache_msi\extracted' -NoNewWindow -PassThru -Wait; RUN Copy-Item C:\php_wincache_msi\extracted\PFiles\php_wincache.dll c:\php\ext;

⁠Configure PHP

RUN Copy-Item C:\php\php.ini-production C:\php\php.ini;

FROM microsoft/iis

COPY --from=php71 ["/php/", "/php/"] COPY --from=php71 ["/vc_redist-x64.exe", "/vc_redist-x64.exe"]

⁠Enable required IIS Features

⁠Install VC Redist 14

⁠Configure IIS

⁠Configure system PATH

RUN dism.exe /Online /Enable-Feature /FeatureName:IIS-CGI /All RUN C:\vc_redist-x64.exe /quiet /install RUN del C:\vc_redist-x64.exe RUN %windir%\system32\inetsrv\appcmd.exe set config /section:system.webServer/fastCgi /+[fullPath='c:\php\php-cgi.exe'] RUN %windir%\system32\inetsrv\appcmd.exe set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='.php',verb='',modules='FastCgiModule',scriptProcessor='c:\php\php-cgi.exe',resourceType='Either'] RUN %windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /[fullPath='c:\php\php-cgi.exe'].instanceMaxRequests:10000 RUN %windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+[fullPath='c:\php\php-cgi.exe'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000'] RUN %windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+[fullPath='c:\php\php-cgi.exe'].environmentVariables.[name='PHPRC',value='C:\php'] RUN %windir%\system32\inetsrv\appcmd.exe set config /section:defaultDocument /enabled:true /+files.[value='index.php'] RUN setx PATH /M %PATH%;C:\php RUN setx PHP /M "C:\php" RUN del C:\inetpub\wwwroot* /Q RUN mkdir C:\inetpub\wwwroot\phpapp

RUN powershell -NoProfile -Command Import-module IISAdministration; New-IISSite -Name "phpapp" -PhysicalPath C:\inetpub\wwwroot\phpapp -BindingInformation "*:8000:"

⁠open ports.

EXPOSE 8000

WORKDIR /inetpub/wwwroot/phpapp

COPY phpapp/ .

Tag summary

Content type

Image

Digest

Size

5.4 GB

Last updated

about 8 years ago

docker pull ppanditrao/windows-php-sample-app