diff --git a/internal/php/__snapshots__/template_test.snap b/internal/php/__snapshots__/template_test.snap new file mode 100755 index 00000000..f2f21ef5 --- /dev/null +++ b/internal/php/__snapshots__/template_test.snap @@ -0,0 +1,2309 @@ + +[TestTemplate_AcgFaka - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n if (!-e \$request_filename){\n rewrite ^(.*)\$ /index.php?s=\$1 last; break;\n }\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-none-nginx-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-none-nginx,owo-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-thinkphp-nginx-1 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx,owo-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-thinkphp-nginx,owo-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-none-nginx,owo-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-codeigniter-nginx,owo-1 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-codeigniter-nginx,owo-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-codeigniter-nginx,owo-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-none-nginx,owo-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-thinkphp-nginx,owo-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-codeigniter-nginx-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-none-nginx-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx,owo-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-codeigniter-nginx-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-thinkphp-nginx-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-none-nginx-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-1 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-codeigniter-nginx,owo-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-codeigniter-nginx-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-thinkphp-nginx,owo-1 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-thinkphp-nginx-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-thinkphp-nginx,owo-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-thinkphp-nginx-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-thinkphp-nginx,owo-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-codeigniter-nginx-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx,owo-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx,owo-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-none-nginx-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-none-nginx-1 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-none-nginx,owo-1 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-none-nginx,owo-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-thinkphp-nginx-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-thinkphp-nginx-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-codeigniter-nginx-1 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-none-nginx,owo-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx-1 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-codeigniter-nginx-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-none-nginx-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-codeigniter-nginx,owo-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-thinkphp-nginx,owo-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-codeigniter-nginx,owo-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx-1+os- - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx,owo-1+os- - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-0+os- - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-0+os-roadrunner - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx,owo-0+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.1 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.1-laravel-nginx,owo-0+os-roadrunner - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx,owo-0+os- - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx,owo-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.1 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.1-laravel-nginx,owo-1+os-roadrunner - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.2 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.1-laravel-nginx-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.1 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.1-laravel-nginx-1+os-roadrunner - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx-0+os- - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx-0+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.1 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.1-laravel-nginx-0+os-roadrunner - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx-1+os- - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx,owo-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.2 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.2-laravel-nginx,owo-1+os-roadrunner - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-0+os- - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-1+os-roadrunner - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx,owo-1+os- - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php7 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/7-laravel-nginx,owo-0+os-roadrunner - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-0+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php7 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.2-laravel-nginx,owo-0+os- - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx,owo-0+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.2 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/7-laravel-nginx,owo-1+os- - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-1+os-roadrunner - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx-0+os-roadrunner - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx-0+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php7 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.2-laravel-nginx-1+os- - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx,owo-0+os-roadrunner - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-0+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.2 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/7-laravel-nginx-0+os- - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php7 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/7-laravel-nginx-1+os-roadrunner - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-none-nginx-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-none-nginx-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www/public +WORKDIR /var/www/public + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-0+os- - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.2 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.2-laravel-nginx,owo-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.2 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.2-laravel-nginx,owo-0+os- - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-0+os-roadrunner - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-codeigniter-nginx,owo-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-codeigniter-nginx,owo-0 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx,owo-1+os-roadrunner - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx,owo-0 - 1] +FROM docker.io/library/php:7-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx-1 - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx-1+os-roadrunner - 1] +FROM docker.io/library/php:8.1-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.1-laravel-nginx-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php8.1 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/7-laravel-nginx,owo-1+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php7 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.2-laravel-nginx-1 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && sync + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + +RUN echo '#!/bin/sh\n\ +extensions=$(cat composer.json | jq -r ".require | to_entries[] | select(.key | startswith(\"ext-\")) | .key[4:]")\n\ +for ext in $extensions; do\n\ + echo "Installing PHP extension: $ext"\n\ + docker-php-ext-install $ext\n\ +done' > /usr/local/bin/install_php_extensions.sh \ + && chmod +x /usr/local/bin/install_php_extensions.sh \ + && /usr/local/bin/install_php_extensions.sh +RUN composer install --optimize-autoloader --no-dev + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx-0+os-roadrunner - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/7-laravel-nginx-0+os-swoole - 1] +FROM docker.io/phpswoole/swoole:php7 +RUN docker-php-ext-install pcntl + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + + +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] + +--- + +[TestTemplate/8.2-laravel-nginx-0 - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- + +[TestTemplate/8.2-laravel-nginx,owo-0+os-roadrunner - 1] +FROM docker.io/library/php:8.2-fpm + +RUN apt-get update && apt-get install -y nginx,owo && rm -rf /var/lib/apt/lists/* + +COPY --chown=www-data:www-data . /var/www +WORKDIR /var/www + +RUN rm /etc/nginx/sites-enabled/default +RUN echo "server {\n listen 8080;\n root /var/www/public;\n\n add_header X-Frame-Options "SAMEORIGIN";\n add_header X-Content-Type-Options "nosniff";\n\n index index.php index.html;\n charset utf-8;\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n error_page 404 /index.php;\n\n location ~ \.php\$ {\n try_files \$uri =404;\n fastcgi_split_path_info ^(.+\.php)(/.+)\$;\n fastcgi_pass 127.0.0.1:9000;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n fastcgi_param PATH_INFO \$fastcgi_path_info;\n fastcgi_buffering off;\n }\n\n location / {\n try_files \$uri \$uri/ /index.php?\$query_string;\n gzip_static on;\n }\n\n location ~ /\.(?!well-known).* {\n deny all;\n }\n}\n" >> /etc/nginx/sites-enabled/default + + +CMD nginx; php-fpm + +--- diff --git a/internal/php/config.go b/internal/php/config.go new file mode 100644 index 00000000..2ad9dcc9 --- /dev/null +++ b/internal/php/config.go @@ -0,0 +1,7 @@ +package php + +// ConfigLaravelOctaneServer defines what server we should use to run Laravel Octane. +// +// When this config is set, we will use the corresponding server to run the project +// instead of the original Nginx + PHP-FPM stack. +const ConfigLaravelOctaneServer = "laravel.octane.server" diff --git a/internal/php/identify.go b/internal/php/identify.go index ce5ee769..faeb6c3a 100644 --- a/internal/php/identify.go +++ b/internal/php/identify.go @@ -26,18 +26,29 @@ func (i *identify) Match(fs afero.Fs) bool { } func (i *identify) PlanMeta(options plan.NewPlannerOptions) types.PlanMeta { + config := options.Config + + server := config.GetString(ConfigLaravelOctaneServer) + framework := DetermineProjectFramework(options.Source) phpVersion := GetPHPVersion(options.Source) - deps := DetermineAptDependencies(options.Source) + deps := DetermineAptDependencies(options.Source, server) app, property := DetermineApplication(options.Source) - return types.PlanMeta{ + // Some meta will be added to the plan dynamically later. + meta := types.PlanMeta{ "framework": string(framework), "phpVersion": phpVersion, "deps": strings.Join(deps, " "), "app": string(app), "property": PropertyToString(property), } + + if framework == types.PHPFrameworkLaravel && server != "" { + meta["octaneServer"] = server + } + + return meta } var _ plan.Identifier = (*identify)(nil) diff --git a/internal/php/php.go b/internal/php/php.go index 19a8df84..19908a7c 100644 --- a/internal/php/php.go +++ b/internal/php/php.go @@ -12,19 +12,25 @@ import ( func GenerateDockerfile(meta types.PlanMeta) (string, error) { phpVersion := meta["phpVersion"] projectProperty := PropertyFromString(meta["property"]) + serverMode := "fpm" getPhpImage := "FROM docker.io/library/php:" + phpVersion + "-fpm\n" - nginxConf, err := RetrieveNginxConf(meta["app"]) - if err != nil { - return "", fmt.Errorf("retrieve nginx conf: %w", err) + // Custom server for Laravel Octane + switch meta["octaneServer"] { + case "": // ignore + case "roadrunner": // unimplemented + case "swoole": + getPhpImage = "FROM docker.io/phpswoole/swoole:php" + phpVersion + "\n" + + "RUN docker-php-ext-install pcntl\n" + serverMode = "swoole" } installCMD := fmt.Sprintf(` RUN apt-get update && apt-get install -y %s && rm -rf /var/lib/apt/lists/* `, meta["deps"]) if projectProperty&types.PHPPropertyComposer != 0 { - installCMD += `\ + installCMD += ` RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions && sync @@ -44,11 +50,18 @@ WORKDIR /var/www ` } - // generate Nginx config to let it pass the request to php-fpm - copyCommand += ` + if serverMode == "fpm" { + // generate Nginx config to let it pass the request to php-fpm + nginxConf, err := RetrieveNginxConf(meta["app"]) + if err != nil { + return "", fmt.Errorf("retrieve nginx conf: %w", err) + } + + copyCommand += ` RUN rm /etc/nginx/sites-enabled/default RUN echo "` + nginxConf + `" >> /etc/nginx/sites-enabled/default ` + } // install dependencies with composer composerInstallCmd := "\n" @@ -69,6 +82,12 @@ RUN composer install --optimize-autoloader --no-dev startCmd := ` CMD nginx; php-fpm ` + // Custom server for Laravel Octane + if serverMode == "swoole" { + startCmd = ` +CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8080"] +` + } dockerFile := getPhpImage + installCMD + diff --git a/internal/php/plan.go b/internal/php/plan.go index 4ae16d2e..3f5eb590 100644 --- a/internal/php/plan.go +++ b/internal/php/plan.go @@ -96,13 +96,22 @@ var depMap = map[string][]string{ "ext-gmp": {"libgmp-dev"}, } -var baseDep = []string{"nginx", "libicu-dev", "jq", "pkg-config", "unzip", "git"} +var baseDep = []string{"libicu-dev", "jq", "pkg-config", "unzip", "git"} // DetermineAptDependencies determines the required apt dependencies of the project. -func DetermineAptDependencies(source afero.Fs) []string { +// +// We install Nginx server unless server is "swoole". +func DetermineAptDependencies(source afero.Fs, server string) []string { // deep copy the base dependencies dependencies := append([]string{}, baseDep...) + // If Octane Server is not "swoole", we should install Nginx. + // + // TODO: support RoadRunner + if server != "swoole" { + dependencies = append(dependencies, "nginx") + } + composerJSON, err := parseComposerJSON(source) if err != nil { return dependencies diff --git a/internal/php/plan_apt_test.go b/internal/php/plan_apt_test.go index dde74947..6fd6d999 100644 --- a/internal/php/plan_apt_test.go +++ b/internal/php/plan_apt_test.go @@ -1,6 +1,5 @@ package php -// due to some internal logics, we need to do blackbox test import ( "testing" @@ -8,11 +7,13 @@ import ( "github.com/stretchr/testify/assert" ) +var baseDepsWithNginx = append(baseDep, "nginx") + func TestDetermineAptDependencies_None(t *testing.T) { fs := afero.NewMemMapFs() - deps := DetermineAptDependencies(fs) - assert.Equal(t, deps, baseDep) + deps := DetermineAptDependencies(fs, "") + assert.Equal(t, baseDepsWithNginx, deps) } func TestDetermineAptDependencies_NoRequire(t *testing.T) { @@ -21,8 +22,8 @@ func TestDetermineAptDependencies_NoRequire(t *testing.T) { "name": "test" }`), 0o644) - deps := DetermineAptDependencies(fs) - assert.Equal(t, deps, baseDep) + deps := DetermineAptDependencies(fs, "") + assert.Equal(t, baseDepsWithNginx, deps) } func TestDetermineAptDependencies_EmptyRequire(t *testing.T) { @@ -32,8 +33,8 @@ func TestDetermineAptDependencies_EmptyRequire(t *testing.T) { "require": {} }`), 0o644) - deps := DetermineAptDependencies(fs) - assert.Equal(t, deps, baseDep) + deps := DetermineAptDependencies(fs, "") + assert.Equal(t, baseDepsWithNginx, deps) } func TestDetermineAptDependencies_RequireOpenssl(t *testing.T) { @@ -45,8 +46,8 @@ func TestDetermineAptDependencies_RequireOpenssl(t *testing.T) { } }`), 0o644) - deps := DetermineAptDependencies(fs) - assert.Equal(t, deps, append(baseDep, depMap["ext-openssl"]...)) + deps := DetermineAptDependencies(fs, "") + assert.Equal(t, append(baseDepsWithNginx, depMap["ext-openssl"]...), deps) } func TestDetermineAptDependencies_RequireZip(t *testing.T) { @@ -58,8 +59,8 @@ func TestDetermineAptDependencies_RequireZip(t *testing.T) { } }`), 0o644) - deps := DetermineAptDependencies(fs) - assert.Equal(t, deps, append(baseDep, depMap["ext-zip"]...)) + deps := DetermineAptDependencies(fs, "") + assert.Equal(t, append(baseDepsWithNginx, depMap["ext-zip"]...), deps) } func TestDetermineAptDependencies_RequireCurl(t *testing.T) { @@ -71,8 +72,8 @@ func TestDetermineAptDependencies_RequireCurl(t *testing.T) { } }`), 0o644) - deps := DetermineAptDependencies(fs) - assert.Equal(t, deps, append(baseDep, depMap["ext-curl"]...)) + deps := DetermineAptDependencies(fs, "") + assert.Equal(t, append(baseDepsWithNginx, depMap["ext-curl"]...), deps) } func TestDetermineAptDependencies_RequireGd(t *testing.T) { @@ -84,6 +85,20 @@ func TestDetermineAptDependencies_RequireGd(t *testing.T) { } }`), 0o644) - deps := DetermineAptDependencies(fs) - assert.Equal(t, deps, append(baseDep, depMap["ext-gd"]...)) + deps := DetermineAptDependencies(fs, "") + assert.Equal(t, append(baseDepsWithNginx, depMap["ext-gd"]...), deps) +} + +func TestDetermineAptDependencies_Swoole(t *testing.T) { + fs := afero.NewMemMapFs() + + deps := DetermineAptDependencies(fs, "swoole") + assert.Equal(t, baseDep, deps) +} + +func TestDetermineAptDependencies_Unknown(t *testing.T) { + fs := afero.NewMemMapFs() + + deps := DetermineAptDependencies(fs, "unknown") + assert.Equal(t, baseDepsWithNginx, deps) } diff --git a/internal/php/template_test.go b/internal/php/template_test.go new file mode 100644 index 00000000..3f3c6b13 --- /dev/null +++ b/internal/php/template_test.go @@ -0,0 +1,103 @@ +package php_test + +import ( + "testing" + + "github.com/gkampitakis/go-snaps/snaps" + "github.com/stretchr/testify/assert" + "github.com/zeabur/zbpack/internal/php" + "github.com/zeabur/zbpack/pkg/types" +) + +func TestTemplate(t *testing.T) { + t.Parallel() + + phpVersion := []string{ + "8.1", + "8.2", + "7", + } + framework := []string{ + string(types.PHPFrameworkNone), + string(types.PHPFrameworkLaravel), + string(types.PHPFrameworkThinkphp), + string(types.PHPFrameworkCodeigniter), + } + deps := []string{ + "nginx", + "nginx,owo", + } + property := []string{ + php.PropertyToString(types.PHPPropertyNone), + php.PropertyToString(types.PHPPropertyComposer), + } + octaneServer := []string{ + "", + "roadrunner", + "swoole", + } + + for _, v := range phpVersion { + v := v + for _, d := range deps { + d := d + for _, f := range framework { + f := f + for _, p := range property { + p := p + t.Run(v+"-"+f+"-"+d+"-"+p, func(t *testing.T) { + t.Parallel() + + dockerfile, err := php.GenerateDockerfile(types.PlanMeta{ + "phpVersion": v, + "framework": f, + "deps": d, + "app": string(types.PHPApplicationDefault), + "property": p, + }) + + assert.NoError(t, err) + snaps.MatchSnapshot(t, dockerfile) + }) + + if f == string(types.PHPFrameworkLaravel) { + for _, o := range octaneServer { + o := o + + t.Run(v+"-"+f+"-"+d+"-"+p+"+os-"+o, func(t *testing.T) { + t.Parallel() + + dockerfile, err := php.GenerateDockerfile(types.PlanMeta{ + "phpVersion": v, + "framework": f, + "deps": d, + "app": string(types.PHPApplicationDefault), + "property": p, + "octaneServer": o, + }) + + assert.NoError(t, err) + snaps.MatchSnapshot(t, dockerfile) + }) + } + } + } + } + } + } +} + +func TestTemplate_AcgFaka(t *testing.T) { + t.Parallel() + + dockerfile, err := php.GenerateDockerfile(types.PlanMeta{ + "phpVersion": "8.2", + "framework": string(types.PHPFrameworkLaravel), + "deps": "nginx", + "app": string(types.PHPApplicationAcgFaka), + "property": php.PropertyToString(types.PHPPropertyComposer), + }) + + assert.NoError(t, err) + snaps.MatchSnapshot(t, dockerfile) +}