$ docker pull gitmaspaad/debian-php:1.2
or
from gitmaspaad/debian-php:1.2
Save Dockerfile to C:\Users\username\docker-src\debian-php
Locate to directory
cd %USERPROFILE%\docker-src\debian-php
Format : docker build --no-cache -t example_different_name:tag_number .
docker build --no-cache -t debian/php:1.2 .
All right, the last step.
docker run -it --name=ctr-debian-php-1.2 --privileged --dns 8.8.8.8 --dns 8.8.4.4 -p 9030:9030/tcp -p 9040-9044:9040-9044/tcp -p 9050-9056:9050-9056/tcp -p 9070-9074:9070-9074/tcp -p 9080-9085:9080-9085/tcp -v C:\Wnmp\nginx\www:/var/www -d gitmaspaad/debian-php:1.2 /lib/systemd/systemd
After container runs. Login into container.
docker exec -u 0 -it ctr-debian-php-1.2 bash
Turn on (manually) php service inside the container.
systemctl start php-p9074-v7.4.service
FYI. I'm doing development by using Wnmp on Windows 11. So, it's by default use Nginx as web server. Here is the Nginx configuration.
# ==========================================
# Main Server Block for PHP Application
# ==========================================
server {
listen 6031 default_server;
listen [::]:6031 default_server;
server_name _ localhost 127.0.0.1;
index index.php index.html;
root c:/wnmp/nginx/www;
proxy_hide_header Access-Control-Allow-Origin;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
## If no favicon exists return a 204 (no content error).
location = /favicon.ico {
try_files $uri =204;
log_not_found off;
access_log off;
}
## Don't log robots.txt requests.
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
## Try the requested URI as files before handling it to PHP.
location /php56
{
# rewrite /(.*)$ /$1 break;
# try_files $uri $uri/ /index.html;
try_files $uri $uri/ /php56/index.php$args;
# kill cache
sendfile off;
add_header Last-Modified $date_gmt;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
proxy_no_cache 1;
proxy_cache_bypass 1;
proxy_http_version 1.1;
# proxy_pass http://localhost:7000/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10M;
## Regular PHP processing.
# location ~ ^/php56/(.+\.php)$
location ~ \.php$
{
try_files $uri =404;
fastcgi_pass 127.0.0.1:9056;
# fastcgi_pass php_processes;
fastcgi_index index.php;
# use this if your php inside docker container, but the doc root inside windows. Example C:\Wnmp\nginx\www
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
# fastcgi_param SCRIPT_FILENAME /var/www/php56$fastcgi_script_name;
# use this if your php and doc root in the same environment / the same os
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
## Static files
location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf)$ {
expires max;
log_not_found off;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
## Set the OS file cache.
open_file_cache max=1000 inactive=120s;
open_file_cache_valid 45s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
}
## Keep a tab on the 'big' static files.
location ~* ^.+\.(?:ogg|pdf|pptx?)$ {
expires 30d;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
}
} # / location
## Try the requested URI as files before handling it to PHP.
location /php70
{
# rewrite /(.*)$ /$1 break;
# try_files $uri $uri/ /index.html;
try_files $uri $uri/ /index.php$args;
# try_files $uri $uri/ /php70/index.php$args;
# kill cache
sendfile off;
add_header Last-Modified $date_gmt;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
proxy_no_cache 1;
proxy_cache_bypass 1;
proxy_http_version 1.1;
# proxy_pass http://localhost:7000/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10M;
## Regular PHP processing.
# location ~ ^/php56/(.+\.php)$
location ~ \.php$
{
try_files $uri =404;
fastcgi_pass 127.0.0.1:9070;
# fastcgi_pass php_processes;
fastcgi_index index.php;
# use this if your php inside docker container, but the doc root inside windows. Example C:\Wnmp\nginx\www
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
# fastcgi_param SCRIPT_FILENAME /var/www/php70$fastcgi_script_name;
# use this if your php and doc root in the same environment / the same os
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
## Static files
location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf)$ {
expires max;
log_not_found off;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
## Set the OS file cache.
open_file_cache max=1000 inactive=120s;
open_file_cache_valid 45s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
}
## Keep a tab on the 'big' static files.
location ~* ^.+\.(?:ogg|pdf|pptx?)$ {
expires 30d;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
}
} # / location
}
https://sourceforge.net/projects/wnmp-env/files/wnmp/
Content type
Image
Digest
sha256:4f60bdb70…
Size
12.6 GB
Last updated
about 18 hours ago
docker pull gitmaspaad/debian-php:1.2