Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ '8.0', '8.1', '8.2', '8.3' ]
version: [ '8.1', '8.2', '8.3', '8.4' ]
type: [ '', '-prod' ]

steps:
Expand All @@ -37,6 +37,7 @@ jobs:
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} php -v
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} wp --allow-root --version
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} nginx -v
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} nginx -t
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} supervisord version

- name: Test docker images wordpress code
Expand Down
15 changes: 0 additions & 15 deletions 7.4-nginx/Dockerfile

This file was deleted.

92 changes: 0 additions & 92 deletions 7.4-nginx/entrypoint

This file was deleted.

15 changes: 0 additions & 15 deletions 8.0-nginx/Dockerfile

This file was deleted.

92 changes: 0 additions & 92 deletions 8.0-nginx/entrypoint

This file was deleted.

5 changes: 3 additions & 2 deletions 8.1-nginx-prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM wordpress:cli-php8.1 as wordpress-cli
FROM wordpress:php8.1-fpm-alpine as wordpress
FROM wordpress:cli-php8.1 AS wordpress-cli
FROM wordpress:php8.1-fpm-alpine AS wordpress
FROM kooldev/php:8.1-nginx-prod

ENV NGINX_ROOT=/app
Expand All @@ -8,6 +8,7 @@ COPY --from=wordpress-cli /usr/local/bin/wp /usr/local/bin/wp
COPY --from=wordpress --chown=kool:kool /usr/src/wordpress /kool/wordpress
COPY --from=wordpress --chown=kool:kool /var/www/html/wp-content /app/wp-content
COPY entrypoint /kool/wordpress-entrypoint
COPY wordpress-webp.conf /etc/nginx/wordpress-webp.conf

RUN chmod -R 777 wp-content && chmod +x /kool/wordpress-entrypoint

Expand Down
5 changes: 3 additions & 2 deletions 8.1-nginx-prod/entrypoint
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
set -eo pipefail

# Nginx server config
dockerize -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
# Add WebP support for WordPress by injecting include directive
# Insert the include directive before the location / block
sed -i 's/\( location \/ {\)/ # Include WordPress WebP support\n include \/etc\/nginx\/wordpress-webp.conf;\n\n\1/' /kool/default.tmpl

# Run as current user
CURRENT_USER=${ASUSER:-${UID:-0}}
Expand Down
17 changes: 17 additions & 0 deletions 8.1-nginx-prod/wordpress-webp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# WordPress WebP support: automatically serve WebP images when available and supported
location ~* ^(.+)\.(jpe?g|png)$ {
set $webp_suffix "";

# Check if WebP is supported by the client
if ($http_accept ~* "image/webp") {
set $webp_suffix ".webp";
}

# Try to serve the WebP version first, then fallback to original
try_files $uri$webp_suffix $uri /index.php?$query_string;

# Set appropriate cache headers for images
expires 30d;
add_header Cache-Control "public, immutable";
add_header Vary "Accept";
}
5 changes: 3 additions & 2 deletions 8.1-nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM wordpress:cli-php8.1 as wordpress-cli
FROM wordpress:php8.1-fpm-alpine as wordpress
FROM wordpress:cli-php8.1 AS wordpress-cli
FROM wordpress:php8.1-fpm-alpine AS wordpress
FROM kooldev/php:8.1-nginx

ENV NGINX_ROOT=/app
Expand All @@ -8,6 +8,7 @@ COPY --from=wordpress-cli /usr/local/bin/wp /usr/local/bin/wp
COPY --from=wordpress --chown=kool:kool /usr/src/wordpress /kool/wordpress
COPY --from=wordpress --chown=kool:kool /var/www/html/wp-content /app/wp-content
COPY entrypoint /kool/wordpress-entrypoint
COPY wordpress-webp.conf /etc/nginx/wordpress-webp.conf

RUN chmod -R 777 wp-content && chmod +x /kool/wordpress-entrypoint

Expand Down
5 changes: 3 additions & 2 deletions 8.1-nginx/entrypoint
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
set -eo pipefail

# Nginx server config
dockerize -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
# Add WebP support for WordPress by injecting include directive
# Insert the include directive before the location / block
sed -i 's/\( location \/ {\)/ # Include WordPress WebP support\n include \/etc\/nginx\/wordpress-webp.conf;\n\n\1/' /kool/default.tmpl

# Run as current user
CURRENT_USER=${ASUSER:-${UID:-0}}
Expand Down
17 changes: 17 additions & 0 deletions 8.1-nginx/wordpress-webp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# WordPress WebP support: automatically serve WebP images when available and supported
location ~* ^(.+)\.(jpe?g|png)$ {
set $webp_suffix "";

# Check if WebP is supported by the client
if ($http_accept ~* "image/webp") {
set $webp_suffix ".webp";
}

# Try to serve the WebP version first, then fallback to original
try_files $uri$webp_suffix $uri /index.php?$query_string;

# Set appropriate cache headers for images
expires 30d;
add_header Cache-Control "public, immutable";
add_header Vary "Accept";
}
5 changes: 3 additions & 2 deletions 8.2-nginx-prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM wordpress:cli-php8.2 as wordpress-cli
FROM wordpress:php8.2-fpm-alpine as wordpress
FROM wordpress:cli-php8.2 AS wordpress-cli
FROM wordpress:php8.2-fpm-alpine AS wordpress
FROM kooldev/php:8.2-nginx-prod

ENV NGINX_ROOT=/app
Expand All @@ -8,6 +8,7 @@ COPY --from=wordpress-cli /usr/local/bin/wp /usr/local/bin/wp
COPY --from=wordpress --chown=kool:kool /usr/src/wordpress /kool/wordpress
COPY --from=wordpress --chown=kool:kool /var/www/html/wp-content /app/wp-content
COPY entrypoint /kool/wordpress-entrypoint
COPY wordpress-webp.conf /etc/nginx/wordpress-webp.conf

RUN chmod -R 777 wp-content && chmod +x /kool/wordpress-entrypoint

Expand Down
5 changes: 3 additions & 2 deletions 8.2-nginx-prod/entrypoint
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
set -eo pipefail

# Nginx server config
dockerize -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
# Add WebP support for WordPress by injecting include directive
# Insert the include directive before the location / block
sed -i 's/\( location \/ {\)/ # Include WordPress WebP support\n include \/etc\/nginx\/wordpress-webp.conf;\n\n\1/' /kool/default.tmpl

# Run as current user
CURRENT_USER=${ASUSER:-${UID:-0}}
Expand Down
17 changes: 17 additions & 0 deletions 8.2-nginx-prod/wordpress-webp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# WordPress WebP support: automatically serve WebP images when available and supported
location ~* ^(.+)\.(jpe?g|png)$ {
set $webp_suffix "";

# Check if WebP is supported by the client
if ($http_accept ~* "image/webp") {
set $webp_suffix ".webp";
}

# Try to serve the WebP version first, then fallback to original
try_files $uri$webp_suffix $uri /index.php?$query_string;

# Set appropriate cache headers for images
expires 30d;
add_header Cache-Control "public, immutable";
add_header Vary "Accept";
}
5 changes: 3 additions & 2 deletions 8.2-nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM wordpress:cli-php8.2 as wordpress-cli
FROM wordpress:php8.2-fpm-alpine as wordpress
FROM wordpress:cli-php8.2 AS wordpress-cli
FROM wordpress:php8.2-fpm-alpine AS wordpress
FROM kooldev/php:8.2-nginx

ENV NGINX_ROOT=/app
Expand All @@ -8,6 +8,7 @@ COPY --from=wordpress-cli /usr/local/bin/wp /usr/local/bin/wp
COPY --from=wordpress --chown=kool:kool /usr/src/wordpress /kool/wordpress
COPY --from=wordpress --chown=kool:kool /var/www/html/wp-content /app/wp-content
COPY entrypoint /kool/wordpress-entrypoint
COPY wordpress-webp.conf /etc/nginx/wordpress-webp.conf

RUN chmod -R 777 wp-content && chmod +x /kool/wordpress-entrypoint

Expand Down
Loading