Skip to content

Commit

Permalink
⚡️ IMPROVE: update alpine linux and add php 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
asapdotid committed Jun 18, 2024
1 parent 488bbc8 commit 1a4fd9b
Show file tree
Hide file tree
Showing 35 changed files with 431 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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`

Expand Down
31 changes: 31 additions & 0 deletions src/php/8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions src/php/8.3/conf/bin/service.d/nginx.d/10-init.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions src/php/8.3/conf/bin/service.d/nginx.sh
Original file line number Diff line number Diff line change
@@ -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
Empty file.
3 changes: 3 additions & 0 deletions src/php/8.3/conf/etc/nginx/conf.d/10-php.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
upstream php {
server <PHP_SOCKET>;
}
2 changes: 2 additions & 0 deletions src/php/8.3/conf/etc/nginx/main.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include /opt/docker/etc/nginx/conf.d/*.conf;
include /opt/docker/etc/nginx/vhost.conf;
45 changes: 45 additions & 0 deletions src/php/8.3/conf/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
25 changes: 25 additions & 0 deletions src/php/8.3/conf/etc/nginx/snippets/error.conf
Original file line number Diff line number Diff line change
@@ -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;
}
28 changes: 28 additions & 0 deletions src/php/8.3/conf/etc/nginx/ssl/server.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIE1DCCArwCCQDMMwGnSuK0tTANBgkqhkiG9w0BAQsFADAsMRswGQYDVQQKExJE
b2NrZXIgQm9pbGVycGxhdGUxDTALBgNVBAMUBCoudm0wHhcNMTUwNTA0MTcxNDQw
WhcNMjUwNTAxMTcxNDQwWjAsMRswGQYDVQQKExJEb2NrZXIgQm9pbGVycGxhdGUx
DTALBgNVBAMUBCoudm0wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK
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hnIrAaP/zwBH5g9zVizLf5H7U+hNXrMwgw55Sq
vjMdkZHvPKUXTvVit/rYE9H+PY3brkRWzOl4V/i/ZLJJm5805H/NyTbz9kPMJw2Q
nn+KOpfXXySD39f8iuRgSKXsYNul38hxWgcZZ6g+sOOp2n/VUmf0eZUWNnJ8i7AP
4Qif7aDKMcibOwSwsB+DKZXDvZ5XSdnMphtuLS5rPSL81rVRmWC2DMfQ2eP8j0WN
VTroSk0xedQ7Qr+9TNooi9IyzX6n1a2S1UiciEZ3ZcDbXPl/P01m+IYZyPnLv0+9
ZeioZYh1JLv3/OKsMrMLTfh2ZCj3aXwmc2Owi/wU2LS5QUOMcHH7CQ==
-----END CERTIFICATE-----
26 changes: 26 additions & 0 deletions src/php/8.3/conf/etc/nginx/ssl/server.csr
Original file line number Diff line number Diff line change
@@ -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-----
51 changes: 51 additions & 0 deletions src/php/8.3/conf/etc/nginx/ssl/server.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE K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additions & 0 deletions src/php/8.3/conf/etc/nginx/vhost.common.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# compatibility for PHP and TYPO3 Docker Boilerplate
include /opt/docker/etc/nginx/vhost.common.d/*.conf;
Empty file.
1 change: 1 addition & 0 deletions src/php/8.3/conf/etc/nginx/vhost.common.d/10-general.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client_max_body_size <SERVICE_NGINX_CLIENT_MAX_BODY_SIZE>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
location / {
try_files $uri $uri/ /<DOCUMENT_INDEX>?$query_string;
}
2 changes: 2 additions & 0 deletions src/php/8.3/conf/etc/nginx/vhost.common.d/10-log.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
access_log /docker.stdout;
error_log /docker.stderr warn;
7 changes: 7 additions & 0 deletions src/php/8.3/conf/etc/nginx/vhost.common.d/10-php.conf
Original file line number Diff line number Diff line change
@@ -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 <PHP_TIMEOUT>;
}
34 changes: 34 additions & 0 deletions src/php/8.3/conf/etc/nginx/vhost.common.d/10-security.conf
Original file line number Diff line number Diff line change
@@ -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;
}
30 changes: 30 additions & 0 deletions src/php/8.3/conf/etc/nginx/vhost.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
server {
listen 80 default_server;
listen [::]:80 default_server;

server_name _ <ALIAS_DOMAIN> docker;

root "<DOCUMENT_ROOT>";
index <DOCUMENT_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 _ <ALIAS_DOMAIN> docker;

root "<DOCUMENT_ROOT>";
index <DOCUMENT_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;
}
6 changes: 6 additions & 0 deletions src/php/8.3/conf/etc/nginx/vhost.ssl.conf
Original file line number Diff line number Diff line change
@@ -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;
14 changes: 14 additions & 0 deletions src/php/8.3/conf/etc/supervisor.d/nginx.conf
Original file line number Diff line number Diff line change
@@ -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
Empty file.
Loading

0 comments on commit 1a4fd9b

Please sign in to comment.