From 1a4fd9b07ad43957d751d75c1cb0e36c23fca776 Mon Sep 17 00:00:00 2001 From: Asapdotid Date: Tue, 18 Jun 2024 17:33:08 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20IMPROVE:=20update=20alpine?= =?UTF-8?q?=20linux=20and=20add=20php=208.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++-- src/php/8.3/Dockerfile | 31 +++++++++++ .../8.3/conf/bin/service.d/nginx.d/10-init.sh | 5 ++ src/php/8.3/conf/bin/service.d/nginx.sh | 10 ++++ src/php/8.3/conf/etc/nginx/conf.d/.gitkeep | 0 src/php/8.3/conf/etc/nginx/conf.d/10-php.conf | 3 ++ src/php/8.3/conf/etc/nginx/main.conf | 2 + src/php/8.3/conf/etc/nginx/nginx.conf | 45 ++++++++++++++++ .../8.3/conf/etc/nginx/snippets/error.conf | 25 +++++++++ src/php/8.3/conf/etc/nginx/ssl/server.crt | 28 ++++++++++ src/php/8.3/conf/etc/nginx/ssl/server.csr | 26 ++++++++++ src/php/8.3/conf/etc/nginx/ssl/server.key | 51 +++++++++++++++++++ src/php/8.3/conf/etc/nginx/vhost.common.conf | 2 + .../conf/etc/nginx/vhost.common.d/.gitkeep | 0 .../etc/nginx/vhost.common.d/10-general.conf | 1 + .../vhost.common.d/10-location-root.conf | 3 ++ .../conf/etc/nginx/vhost.common.d/10-log.conf | 2 + .../conf/etc/nginx/vhost.common.d/10-php.conf | 7 +++ .../etc/nginx/vhost.common.d/10-security.conf | 34 +++++++++++++ src/php/8.3/conf/etc/nginx/vhost.conf | 30 +++++++++++ src/php/8.3/conf/etc/nginx/vhost.ssl.conf | 6 +++ src/php/8.3/conf/etc/supervisor.d/nginx.conf | 14 +++++ .../8.3/conf/provision/bootstrap.d/.gitkeep | 0 .../conf/provision/bootstrap.d/10-nginx.sh | 38 ++++++++++++++ .../8.3/conf/provision/bootstrap.d/10-php.sh | 7 +++ .../8.3/conf/provision/entrypoint.d/.gitkeep | 0 .../conf/provision/entrypoint.d/20-nginx.sh | 24 +++++++++ .../provision/entrypoint.d/30-composer.sh | 11 ++++ src/php/8.3/conf/service.d/nginx.d/10-init.sh | 5 ++ src/php/8.3/conf/service.d/nginx.sh | 10 ++++ src/php/8.3/html/errors/403.html | 1 + src/php/8.3/html/errors/404.html | 1 + src/php/8.3/html/errors/502.html | 1 + src/php/8.3/www/index.php | 2 + src/php/8.3/www/test.html | 1 + 35 files changed, 431 insertions(+), 4 deletions(-) create mode 100644 src/php/8.3/Dockerfile create mode 100644 src/php/8.3/conf/bin/service.d/nginx.d/10-init.sh create mode 100644 src/php/8.3/conf/bin/service.d/nginx.sh create mode 100644 src/php/8.3/conf/etc/nginx/conf.d/.gitkeep create mode 100644 src/php/8.3/conf/etc/nginx/conf.d/10-php.conf create mode 100644 src/php/8.3/conf/etc/nginx/main.conf create mode 100644 src/php/8.3/conf/etc/nginx/nginx.conf create mode 100755 src/php/8.3/conf/etc/nginx/snippets/error.conf create mode 100644 src/php/8.3/conf/etc/nginx/ssl/server.crt create mode 100644 src/php/8.3/conf/etc/nginx/ssl/server.csr create mode 100644 src/php/8.3/conf/etc/nginx/ssl/server.key create mode 100644 src/php/8.3/conf/etc/nginx/vhost.common.conf create mode 100644 src/php/8.3/conf/etc/nginx/vhost.common.d/.gitkeep create mode 100644 src/php/8.3/conf/etc/nginx/vhost.common.d/10-general.conf create mode 100644 src/php/8.3/conf/etc/nginx/vhost.common.d/10-location-root.conf create mode 100644 src/php/8.3/conf/etc/nginx/vhost.common.d/10-log.conf create mode 100644 src/php/8.3/conf/etc/nginx/vhost.common.d/10-php.conf create mode 100644 src/php/8.3/conf/etc/nginx/vhost.common.d/10-security.conf create mode 100644 src/php/8.3/conf/etc/nginx/vhost.conf create mode 100644 src/php/8.3/conf/etc/nginx/vhost.ssl.conf create mode 100644 src/php/8.3/conf/etc/supervisor.d/nginx.conf create mode 100644 src/php/8.3/conf/provision/bootstrap.d/.gitkeep create mode 100644 src/php/8.3/conf/provision/bootstrap.d/10-nginx.sh create mode 100644 src/php/8.3/conf/provision/bootstrap.d/10-php.sh create mode 100644 src/php/8.3/conf/provision/entrypoint.d/.gitkeep create mode 100644 src/php/8.3/conf/provision/entrypoint.d/20-nginx.sh create mode 100644 src/php/8.3/conf/provision/entrypoint.d/30-composer.sh create mode 100644 src/php/8.3/conf/service.d/nginx.d/10-init.sh create mode 100644 src/php/8.3/conf/service.d/nginx.sh create mode 100755 src/php/8.3/html/errors/403.html create mode 100755 src/php/8.3/html/errors/404.html create mode 100755 src/php/8.3/html/errors/502.html create mode 100755 src/php/8.3/www/index.php create mode 100755 src/php/8.3/www/test.html diff --git a/README.md b/README.md index ead2ee6..473797d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Docker Image PHP and Nginx - Base image: `webdevops/php` -- OS image: Alpine Linux v3.16 & v3.18 +- OS image: Alpine Linux v3.16 & v3.20 Setup docker image multiple platform: @@ -15,9 +15,10 @@ Setup docker image multiple platform: PHP & Nginx (stable) Version: -- PHP: 8.2 & NGINX: 1.24.0 -- PHP: 8.1 & NGINX: 1.24.0 -- PHP: 7.4 & NGINX: 1.22.1 +- PHP: 8.3 & NGINX: 1.24.0 (Alpine Linux 3.20) +- PHP: 8.2 & NGINX: 1.24.0 (Alpine Linux 3.20) +- PHP: 8.1 & NGINX: 1.24.0 (Alpine Linux 3.20) +- PHP: 7.4 & NGINX: 1.22.1 (Alpine Linux 3.16) **PHP** Socket port: `127.0.0.1:9000` diff --git a/src/php/8.3/Dockerfile b/src/php/8.3/Dockerfile new file mode 100644 index 0000000..dc185bf --- /dev/null +++ b/src/php/8.3/Dockerfile @@ -0,0 +1,31 @@ +FROM webdevops/php:8.3-alpine + +ENV CONTAINER_WORKDIR_PATH=/app +ENV WEB_DOCUMENT_ROOT=${CONTAINER_WORKDIR_PATH} \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.local \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 +ENV SERVICE_NGINX_CLIENT_MAX_BODY_SIZE="80m" +ENV TIMEZONE=Asia/Jakarta +ENV PHP_DATE_TIMEZONE=${TIMEZONE} +ENV APPLICATION_ENV=production +ENV SKIP_COMPOSER=false + +COPY src/php/8.3/conf/ /opt/docker/ +COPY src/php/8.3/html/errors/ /var/www/errors/ +COPY src/php/8.3/www/ $CONTAINER_WORKDIR_PATH/ + +# set timezone +RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && echo $TIMEZONE > /etc/timezone + +RUN set -x \ + # Install nginx + && apk-install \ + nginx \ + && docker-run-bootstrap \ + && docker-image-cleanup + +EXPOSE 80 443 +WORKDIR $CONTAINER_WORKDIR_PATH diff --git a/src/php/8.3/conf/bin/service.d/nginx.d/10-init.sh b/src/php/8.3/conf/bin/service.d/nginx.d/10-init.sh new file mode 100644 index 0000000..8acb511 --- /dev/null +++ b/src/php/8.3/conf/bin/service.d/nginx.d/10-init.sh @@ -0,0 +1,5 @@ +if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then + echo "" + echo "[WARNING] WEB_DOCUMENT_ROOT does not exists with path \"$WEB_DOCUMENT_ROOT\"!" + echo "" +fi diff --git a/src/php/8.3/conf/bin/service.d/nginx.sh b/src/php/8.3/conf/bin/service.d/nginx.sh new file mode 100644 index 0000000..3517c72 --- /dev/null +++ b/src/php/8.3/conf/bin/service.d/nginx.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_NGINX_OPTS" ]]; then SERVICE_NGINX_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/nginx.d/" + +exec /usr/sbin/nginx -g 'daemon off;' $SERVICE_NGINX_OPTS diff --git a/src/php/8.3/conf/etc/nginx/conf.d/.gitkeep b/src/php/8.3/conf/etc/nginx/conf.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/php/8.3/conf/etc/nginx/conf.d/10-php.conf b/src/php/8.3/conf/etc/nginx/conf.d/10-php.conf new file mode 100644 index 0000000..9abe45f --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/conf.d/10-php.conf @@ -0,0 +1,3 @@ +upstream php { + server ; +} diff --git a/src/php/8.3/conf/etc/nginx/main.conf b/src/php/8.3/conf/etc/nginx/main.conf new file mode 100644 index 0000000..3e594fc --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/main.conf @@ -0,0 +1,2 @@ +include /opt/docker/etc/nginx/conf.d/*.conf; +include /opt/docker/etc/nginx/vhost.conf; diff --git a/src/php/8.3/conf/etc/nginx/nginx.conf b/src/php/8.3/conf/etc/nginx/nginx.conf new file mode 100644 index 0000000..488ef97 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/nginx.conf @@ -0,0 +1,45 @@ +# For more information on configuration, see: +# * Official English Documentation: http://nginx.org/en/docs/ +# * Official Russian Documentation: http://nginx.org/ru/docs/ + +user nginx; +worker_processes auto; +error_log /docker.stdout; +pid /run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /docker.stdout main; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + gzip on; + gzip_proxied any; + gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss; + gzip_vary on; + gzip_disable "msie6"; + + # Hardening + proxy_hide_header X-Powered-By; + fastcgi_hide_header X-Powered-By; + server_tokens off; + + # Load modular configuration files from the /etc/nginx/conf.d directory. + # See http://nginx.org/en/docs/ngx_core_module.html#include + # for more information. + include /etc/nginx/conf.d/*.conf; +} diff --git a/src/php/8.3/conf/etc/nginx/snippets/error.conf b/src/php/8.3/conf/etc/nginx/snippets/error.conf new file mode 100755 index 0000000..61b9473 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/snippets/error.conf @@ -0,0 +1,25 @@ +# +## Error Page Setting +# +error_page 400 401 402 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 /404_html; +error_page 403 /403_html; +error_page 500 501 502 /502_html; + +# error_page 403 /403.html; +location /403_html { + root /var/www/errors; + try_files /403.html =403; + internal; +} +# error_page 404 /404.html; +location /404_html { + root /var/www/errors; + try_files /404.html =404; + internal; +} +# error_page 502 /502.html; +location /502_html { + root /var/www/errors; + try_files /502.html =502; + internal; +} diff --git a/src/php/8.3/conf/etc/nginx/ssl/server.crt b/src/php/8.3/conf/etc/nginx/ssl/server.crt new file mode 100644 index 0000000..6b06949 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/ssl/server.crt @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE1DCCArwCCQDMMwGnSuK0tTANBgkqhkiG9w0BAQsFADAsMRswGQYDVQQKExJE +b2NrZXIgQm9pbGVycGxhdGUxDTALBgNVBAMUBCoudm0wHhcNMTUwNTA0MTcxNDQw +WhcNMjUwNTAxMTcxNDQwWjAsMRswGQYDVQQKExJEb2NrZXIgQm9pbGVycGxhdGUx +DTALBgNVBAMUBCoudm0wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK +3TIUiyDvXelWeY9VXMrpjuZtYpVSDsACLpjFUhMnsP5/iKT0VbeZyqHvmwZjAg4G +Y10d+yZDdgv/xeu0HPOFbtR6pCp10d1tdLHZto5Cyuxu7IQsAVjnD6Ko7XFwtNk7 +9o6JZfAFaGL4w5MokrVmCtspnsMZH7/7zU4f96cbF39zLopnpuXGD6t6DA8Qj3gy +0duaTjs42bYRN+rwLzVKAev99iQ4kPMJn4vV6/Xk6rtoSzC67GQyVZYaFypicD1S +NtsRmgEVvjCBDbrLOneUiRwff6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bXPl/P01m+IYZyPnLv0+9 +ZeioZYh1JLv3/OKsMrMLTfh2ZCj3aXwmc2Owi/wU2LS5QUOMcHH7CQ== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/src/php/8.3/conf/etc/nginx/ssl/server.csr b/src/php/8.3/conf/etc/nginx/ssl/server.csr new file mode 100644 index 0000000..8a9909f --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/ssl/server.csr @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEcTCCAlkCAQAwLDEbMBkGA1UEChMSRG9ja2VyIEJvaWxlcnBsYXRlMQ0wCwYD +VQQDFAQqLnZtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyt0yFIsg +713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik9FW3mcqh75sGYwIOBmNdHfsm +Q3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyELAFY5w+iqO1xcLTZO/aOiWXw +BWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6KZ6blxg+regwPEI94MtHbmk47 +ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEswuuxkMlWWGhcqYnA9UjbbEZoB +Fb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpyCOyv5z+0+rgR0IxzvhabBpFP +ZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9hsuLaM76mR6W1MbIMe7E93o/ +SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEAlXtPCbn+cbKLlxWpA3JS1ePi +/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMoS7OotF/zOaryQYi4NRi0wktt +K6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efqlqSOHrot3R2dS5dFR+iHKW+z +kU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEpMQorPj/GTSra5qT6KkrtHjjh +hThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEAAaAAMA0GCSqGSIb3DQEBCwUA +A4ICAQBsEBgC2YepuZq/8UqvKMZKVy/etDKXj7BB+QPb+leNiKD7p4LDxHJsZSH8 +Ku9uMPeLfiQDn5jA41k5SlGttzvObd65RdEbO3yHpqsg05EGSDDLfaE1k2Al/qmX +/o8roPZF7+2kZthgMAgkcokS54LYqEYTGqOf3J9Ss0yRIZwhaOVebfFIbIOdpw0B +JNMIJPHTMdZrcuRVI+wR1uPLIlEJzBvxTGbTrvPU25WJFtu+EajKqXO0SHdy0yx8 +uH4ykRBJRc36+oYo7nZ5D56dh7pZn3+9J64FKAOV0Q3KqMFieGy053ezuhJd70eZ +UozTgfjs3WpMzoYmKETSyl3XZSdInRe+sUlKPruTsKyg69oYxjPlrGfAmmGcCFca +TnZinT18dI92zK7OtOVkmYeYKC1lwuhftVrNMXzZuHOGpS9NNYtc4nDqDMIEOfV3 +6rCdu03WjEgJ+Z67tJs16xOx9du4/EHxS2Ijn9DPfVJvYy0TgzDi1BUpjWx0KTLx +C4OQbEZ/QTWmHVbSch/hcZhzbf7SNh5RpnW4EtmcpDFjIKMfxJmoKeiTf7qnilx0 +7uRvsZFKoDKRDOFiPfgMg5AOtLHziYsd9m0tJjC2GHvFuPjzOtzhnUUjmmvht170 +2aqKakjST4amg7jzLcs871HX0/WjOtt29NpOz140blkKf1bisg== +-----END CERTIFICATE REQUEST----- \ No newline at end of file diff --git a/src/php/8.3/conf/etc/nginx/ssl/server.key b/src/php/8.3/conf/etc/nginx/ssl/server.key new file mode 100644 index 0000000..c9eec14 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/ssl/server.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAyt0yFIsg713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik +9FW3mcqh75sGYwIOBmNdHfsmQ3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyE +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D +Phw8ccWAzTmKJ7IgLFA982ekyoI9eTmRC159WRgwJxy844qerWF+XC4GyXP+HsTZ +jNRW5Vdi7sqMEyIR7+fIEAhLI88zbATWIPmZv6pC4ybwO7wwtsCMMQNBpdjDprzL +6S12ggikV+U+QKlxGe0FtYqhykRTPJKf32eZqVheWOZJTA/9fgv9ux52oxGycM8O +gmsNAoIBAQC60m5uZnd5uYnPLWkcXYNgq/kbO1UvHHut/FhVMKX7z4MrU0XKNfWO +MECoP5K9bU0aq+Y6KIMe7FapjvT0iSHRu1Cu+HZY8JI2A0xcIAeDijLRl7sP6wrB +q1+2DKgANjRAlWfsEfoX658JBpitPngjOheBnRCMpVQMyUT5HE/BKWf5zwdUB0mY +S+K8nA90HcDeJIS8RcGolbVwUV0oBABhr/cf50lYhqozqCr7YQ33ZGs7Uq3oz8+4 +UARmN2YPLl3Znm3GX12em8c6B0LX8vvA7Jw06Rf2Ksup1+3Ce1PTLiEy9A4FyRf3 +Hc2HmBbnJAtZlr5QikMqlzzAmmLqwH6dAoIBAC+ryaQGJFsijCSuaDfRp/uy9xnd +DjgMdTwjl5WLBmyudChVMANl8eqCbvVO41CN84yORk03oQ4cx0eKxAZaLaSzgkb3 +W0X2nFQe7VJSYMQswCQ+1WfJvEFrIdkEKIa//uQdhqNrgUKSNVhhSTMbNEkDTIWn +ssbv2H9hvUaFt/J/vP9zCKuU5oYvNU7Oi6ZXRYezRn9atlJYanLFoJnHUBRzGms5 +K0vhdCPDXQq87z5Yudoh0jLUQF9Nx0GTWeBceQ9n5hZeRUNQWxP4AJThQX9KSPTS +mbL3Kh4XNRmAUJ2N+Njh+3dg91s+JkKvC1wcspLsmLPQe+9AxBSH9y5JE/8= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/src/php/8.3/conf/etc/nginx/vhost.common.conf b/src/php/8.3/conf/etc/nginx/vhost.common.conf new file mode 100644 index 0000000..a5df62e --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/vhost.common.conf @@ -0,0 +1,2 @@ +# compatibility for PHP and TYPO3 Docker Boilerplate +include /opt/docker/etc/nginx/vhost.common.d/*.conf; diff --git a/src/php/8.3/conf/etc/nginx/vhost.common.d/.gitkeep b/src/php/8.3/conf/etc/nginx/vhost.common.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/php/8.3/conf/etc/nginx/vhost.common.d/10-general.conf b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-general.conf new file mode 100644 index 0000000..31c9bf0 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-general.conf @@ -0,0 +1 @@ +client_max_body_size ; diff --git a/src/php/8.3/conf/etc/nginx/vhost.common.d/10-location-root.conf b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-location-root.conf new file mode 100644 index 0000000..28fd811 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-location-root.conf @@ -0,0 +1,3 @@ +location / { + try_files $uri $uri/ /?$query_string; +} diff --git a/src/php/8.3/conf/etc/nginx/vhost.common.d/10-log.conf b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-log.conf new file mode 100644 index 0000000..9646c68 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-log.conf @@ -0,0 +1,2 @@ +access_log /docker.stdout; +error_log /docker.stderr warn; diff --git a/src/php/8.3/conf/etc/nginx/vhost.common.d/10-php.conf b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-php.conf new file mode 100644 index 0000000..22b08a5 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-php.conf @@ -0,0 +1,7 @@ +location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_read_timeout ; +} diff --git a/src/php/8.3/conf/etc/nginx/vhost.common.d/10-security.conf b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-security.conf new file mode 100644 index 0000000..0a13e01 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/vhost.common.d/10-security.conf @@ -0,0 +1,34 @@ +add_header X-XSS-Protection "1; mode=block" always; +add_header X-Content-Type-Options "nosniff" always; +add_header Referrer-Policy "no-referrer-when-downgrade" always; +add_header Content-Security-Policy "default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always; +add_header Permissions-Policy "interest-cohort=()" always; +add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + +# Nginx configuration enables CORS +add_header 'Access-Control-Allow-Origin' '*' always; +add_header 'Access-Control-Allow-Credentials' 'true' always; +add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; +add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; +add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; + +location ~* \.(jpg|jpeg|gif|png|css|js|ico|webp|tiff|ttf|svg)$ { + expires 5d; +} + +# deny access to . files, for security +location ~ /\. { + log_not_found off; + deny all; +} + +# . files +location ~ /\.(?!well-known) { + deny all; +} + +# block access to sensitive information about git +location /.git { + deny all; + return 403; +} diff --git a/src/php/8.3/conf/etc/nginx/vhost.conf b/src/php/8.3/conf/etc/nginx/vhost.conf new file mode 100644 index 0000000..1f5b5c5 --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/vhost.conf @@ -0,0 +1,30 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + + server_name _ docker; + + root ""; + index ; + + include /opt/docker/etc/nginx/snippets/error.conf; + include /opt/docker/etc/nginx/vhost.common.d/*.conf; +} + +############## +# SSL +############## + +server { + listen 443 ssl default_server; + listen [::]:443 ssl default_server; + + server_name _ docker; + + root ""; + index ; + + include /opt/docker/etc/nginx/snippets/error.conf; + include /opt/docker/etc/nginx/vhost.common.d/*.conf; + include /opt/docker/etc/nginx/vhost.ssl.conf; +} diff --git a/src/php/8.3/conf/etc/nginx/vhost.ssl.conf b/src/php/8.3/conf/etc/nginx/vhost.ssl.conf new file mode 100644 index 0000000..28e8aab --- /dev/null +++ b/src/php/8.3/conf/etc/nginx/vhost.ssl.conf @@ -0,0 +1,6 @@ +ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # not possible to do exclusive +ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA'; +ssl_prefer_server_ciphers on; + +ssl_certificate /opt/docker/etc/nginx/ssl/server.crt; +ssl_certificate_key /opt/docker/etc/nginx/ssl/server.key; diff --git a/src/php/8.3/conf/etc/supervisor.d/nginx.conf b/src/php/8.3/conf/etc/supervisor.d/nginx.conf new file mode 100644 index 0000000..657bf49 --- /dev/null +++ b/src/php/8.3/conf/etc/supervisor.d/nginx.conf @@ -0,0 +1,14 @@ +[group:nginx] +programs=nginxd +priority=20 + +[program:nginxd] +command = /opt/docker/bin/service.d/nginx.sh +process_name=%(program_name)s +startsecs = 0 +autostart = true +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/src/php/8.3/conf/provision/bootstrap.d/.gitkeep b/src/php/8.3/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/php/8.3/conf/provision/bootstrap.d/10-nginx.sh b/src/php/8.3/conf/provision/bootstrap.d/10-nginx.sh new file mode 100644 index 0000000..1ba70f9 --- /dev/null +++ b/src/php/8.3/conf/provision/bootstrap.d/10-nginx.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Remove daemon statement (will be added as command line argument) +go-replace --mode=lineinfile --regex --regex-backrefs \ + -s '^[\s#]*daemon ' -r '' \ + -- /etc/nginx/nginx.conf + +go-replace --mode=line --regex --regex-backrefs \ + -s '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' -r '$1 /docker.stdout $3' \ + -s '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' -r '$1 /docker.stderr $3' \ + -- /etc/nginx/nginx.conf + +# Enable nginx main config +mkdir -p /etc/nginx/conf.d/ +ln -sf /opt/docker/etc/nginx/main.conf /etc/nginx/conf.d/10-docker.conf + +rm -f \ + /etc/nginx/sites-enabled/default \ + /etc/nginx/conf.d/default.conf + +if [[ "$IMAGE_FAMILY" == "RedHat" ]] || [[ "$IMAGE_FAMILY" == "Alpine" ]]; then + ln -sf /opt/docker/etc/nginx/nginx.conf /etc/nginx/nginx.conf +fi + +# Clear log dir +rm -rf /var/lib/nginx/logs +mkdir -p /var/lib/nginx/logs + +# Set log to stdout/stderr +ln -sf /var/lib/nginx/logs/access.log /docker.stdout +ln -sf /var/lib/nginx/logs/error.log /docker.stderr + +# Fix rights of ssl files +chown -R root:root /opt/docker/etc/nginx/ssl +find /opt/docker/etc/nginx/ssl -type d -exec chmod 750 {} \; +find /opt/docker/etc/nginx/ssl -type f -exec chmod 640 {} \; diff --git a/src/php/8.3/conf/provision/bootstrap.d/10-php.sh b/src/php/8.3/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 0000000..4a7d826 --- /dev/null +++ b/src/php/8.3/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Restrict php-fpm to local connection +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 127.0.0.1:9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/src/php/8.3/conf/provision/entrypoint.d/.gitkeep b/src/php/8.3/conf/provision/entrypoint.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/php/8.3/conf/provision/entrypoint.d/20-nginx.sh b/src/php/8.3/conf/provision/entrypoint.d/20-nginx.sh new file mode 100644 index 0000000..0264b6c --- /dev/null +++ b/src/php/8.3/conf/provision/entrypoint.d/20-nginx.sh @@ -0,0 +1,24 @@ +# Create tmp dir for nginx +mkdir -p /var/tmp/nginx/ + +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + +# Replace markers +go-replace \ + -s "" -r "$WEB_DOCUMENT_INDEX" \ + -s "" -r "$WEB_DOCUMENT_ROOT" \ + -s "" -r "$WEB_ALIAS_DOMAIN" \ + -s "" -r "$HOSTNAME" \ + -s "" -r "$WEB_PHP_SOCKET" \ + -s "" -r "$WEB_PHP_TIMEOUT" \ + -s "" -r "$SERVICE_NGINX_CLIENT_MAX_BODY_SIZE" \ + --path=/opt/docker/etc/nginx/ \ + --path-pattern='*.conf' \ + --ignore-empty + +if [[ -z "$WEB_PHP_SOCKET" ]]; then + ## WEB_PHP_SOCKET is not set, remove PHP files + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf +fi diff --git a/src/php/8.3/conf/provision/entrypoint.d/30-composer.sh b/src/php/8.3/conf/provision/entrypoint.d/30-composer.sh new file mode 100644 index 0000000..7721f30 --- /dev/null +++ b/src/php/8.3/conf/provision/entrypoint.d/30-composer.sh @@ -0,0 +1,11 @@ +# Composer install +if [ "$SKIP_COMPOSER" != true ]; then + # Try auto install for composer + if [ -f "$CONTAINER_WORKDIR_PATH/composer.json" ]; then + if [ "$APPLICATION_ENV" == "development" ]; then + composer install --working-dir=$CONTAINER_WORKDIR_PATH + else + composer install --optimize-autoloader --no-interaction --no-progress --working-dir=$CONTAINER_WORKDIR_PATH + fi + fi +fi diff --git a/src/php/8.3/conf/service.d/nginx.d/10-init.sh b/src/php/8.3/conf/service.d/nginx.d/10-init.sh new file mode 100644 index 0000000..8acb511 --- /dev/null +++ b/src/php/8.3/conf/service.d/nginx.d/10-init.sh @@ -0,0 +1,5 @@ +if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then + echo "" + echo "[WARNING] WEB_DOCUMENT_ROOT does not exists with path \"$WEB_DOCUMENT_ROOT\"!" + echo "" +fi diff --git a/src/php/8.3/conf/service.d/nginx.sh b/src/php/8.3/conf/service.d/nginx.sh new file mode 100644 index 0000000..3517c72 --- /dev/null +++ b/src/php/8.3/conf/service.d/nginx.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_NGINX_OPTS" ]]; then SERVICE_NGINX_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/nginx.d/" + +exec /usr/sbin/nginx -g 'daemon off;' $SERVICE_NGINX_OPTS diff --git a/src/php/8.3/html/errors/403.html b/src/php/8.3/html/errors/403.html new file mode 100755 index 0000000..9dec151 --- /dev/null +++ b/src/php/8.3/html/errors/403.html @@ -0,0 +1 @@ +Error 403 - Access Forbidden

Error 403

You are not allowed to enter here.

Please try to go back!

Good luck.

\ No newline at end of file diff --git a/src/php/8.3/html/errors/404.html b/src/php/8.3/html/errors/404.html new file mode 100755 index 0000000..eaf14c0 --- /dev/null +++ b/src/php/8.3/html/errors/404.html @@ -0,0 +1 @@ +Error 404 - Page not found

Error 404

The page you are looking for might have been removed, had its name changed or is temporarily unavailable.

Please try to go back.

Good luck.

\ No newline at end of file diff --git a/src/php/8.3/html/errors/502.html b/src/php/8.3/html/errors/502.html new file mode 100755 index 0000000..110e081 --- /dev/null +++ b/src/php/8.3/html/errors/502.html @@ -0,0 +1 @@ +Site Maintenance

We ll be back soon!

Sorry for the inconvenience but we’re performing some maintenance at the moment.

If you need to you can always contact us, otherwise we’ll be back online shortly!

The Asablabs Team.

\ No newline at end of file diff --git a/src/php/8.3/www/index.php b/src/php/8.3/www/index.php new file mode 100755 index 0000000..bfd863b --- /dev/null +++ b/src/php/8.3/www/index.php @@ -0,0 +1,2 @@ +