Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriipavlov committed Oct 6, 2024
2 parents 0b7f51c + c5f7bc0 commit 25d8f42
Show file tree
Hide file tree
Showing 14 changed files with 173 additions and 125 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ mailhog:
docker-compose -f docker-compose.build.yml run --service-ports --rm --name mailhog mailhog

log:
docker compose logs -f
docker compose logs -f $(PARAMS)

run:
$(LOGO_SH)
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@
"package": {
"name": "solidbunch/wordpress-core",
"type": "laravel-library",
"version": "6.5.5",
"version": "6.6.2",
"dist": {
"type": "zip",
"url": "https://wordpress.org/wordpress-6.5.5.zip"
"url": "https://wordpress.org/wordpress-6.6.2.zip"
}
}
},
{
"type": "git",
"type": "vcs",
"url": "[email protected]:solidbunch/starter-kit-theme.git"
}
],
"require": {
"php": ">=8.1",
"solidbunch/wordpress-core": "6.5.5",
"solidbunch/wordpress-core": "6.6.2",
"composer/installers": "2.2.0",
"solidbunch/starter-kit-theme": "dev-develop",
"wpackagist-plugin/contact-form-7":"5.9.6",
"wpackagist-plugin/redirection":"5.4.2",
"wpackagist-plugin/svg-support": "2.5.5"
"wpackagist-plugin/contact-form-7":"5.9.8",
"wpackagist-plugin/redirection":"5.5.0",
"wpackagist-plugin/svg-support":"2.5.8"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"wpackagist-plugin/rewrite-rules-inspector": "1.4.0",
"wpackagist-plugin/query-monitor": "3.16.3"
"wpackagist-plugin/query-monitor": "3.16.4"
},
"config": {
"optimize-autoloader": true,
Expand Down
215 changes: 122 additions & 93 deletions composer.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions config/environment/.env.main
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ APP_BUILD_MODE=dev

# Docker containers images
# use build: ./dockerfiles/service-name in docker-compose.yml file for building just local images
APP_DATABASE_IMAGE=ghcr.io/solidbunch/starter-kit-mariadb:11.4.2-noble
APP_PHP_IMAGE=ghcr.io/solidbunch/starter-kit-php:8.1-fpm-alpine3.20
APP_NGINX_IMAGE=ghcr.io/solidbunch/starter-kit-nginx:1.27-alpine3.19
APP_DATABASE_IMAGE=ghcr.io/solidbunch/starter-kit-mariadb:11.5.2-noble
APP_PHP_IMAGE=ghcr.io/solidbunch/starter-kit-php:8.2-fpm-alpine3.20
APP_NGINX_IMAGE=ghcr.io/solidbunch/starter-kit-nginx:1.27-alpine3.20
APP_CRON_IMAGE=ghcr.io/solidbunch/starter-kit-cron:1.5-alpine3.20
APP_COMPOSER_IMAGE=ghcr.io/solidbunch/starter-kit-composer:2.7
APP_COMPOSER_IMAGE=ghcr.io/solidbunch/starter-kit-composer:2.8-alpine3.20
APP_NODE_IMAGE=ghcr.io/solidbunch/starter-kit-node:18-alpine3.20
APP_PHPMYADMIN_IMAGE=phpmyadmin:5.2-apache
APP_MAILHOG_IMAGE=mailhog/mailhog:v1.0.1
Expand Down
12 changes: 11 additions & 1 deletion config/nginx/config/common.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
include /etc/nginx/conf.d/config/partials/php.conf;
}

# Allow all REST API requests
location ~ ^/wp-json/ {
try_files $uri $uri/ /index.php?$args;
}

# Robots.txt
location ~ ^/robots.txt {
expires off;
Expand All @@ -57,6 +62,11 @@
return 404;
}

# Close main theme screenshot.png
location ~* ^/wp-content/themes/${WP_DEFAULT_THEME}/screenshot\.png$ {
return 404;
}

# Process all allowed static files including images, fonts, media, documents, etc.
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|webp|avif|bmp|tiff|mp3|mp4|ogg|wav|webm|pdf|doc|docx|ppt|pptx|xls|xlsx|zip|rar|7z|woff|woff2|ttf|otf|eot)$ {
expires max;
Expand All @@ -74,7 +84,7 @@
}

# Deny access to all other files
location ~* \.(.*)$ {
location ~* /[^/]*\.[^/]*$ {
return 404;
}

Expand Down
7 changes: 5 additions & 2 deletions config/nginx/config/partials/php.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
location ~ \.php$ {
try_files $uri =404;
fastcgi_intercept_errors on;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Forward to php-fpm container
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;

# Increase the buffer if there are overflow problems
#fastcgi_buffer_size 16k;
#fastcgi_buffers 16 16k;
#fastcgi_busy_buffers_size 32k;
}

4 changes: 2 additions & 2 deletions config/php/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ ignore_repeated_errors = On
; is On you will not log errors with repeated messages from different files or
; source lines.
; https://php.net/ignore-repeated-source
ignore_repeated_source = Off
ignore_repeated_source = On

; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This is only effective in a debug compile, and if
Expand Down Expand Up @@ -823,7 +823,7 @@ enable_dl = Off

; Disable logging through FastCGI connection. PHP's default behavior is to enable
; this feature.
;fastcgi.logging = 0
fastcgi.logging = 0

; cgi.rfc2616_headers configuration option tells PHP what type of headers to
; use when sending HTTP response code. If set to 0, PHP sends Status: header that
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/composer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM ${APP_PHP_IMAGE}
# Installing PHP Composer #
##################################
# https://hub.docker.com/_/composer
COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2.8 /usr/bin/composer /usr/bin/composer

##################################
# Composer dependencies #
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/mariadb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run from original mariadb ubuntu
FROM mariadb:11.4.2-noble
FROM mariadb:11.5.2-noble

# Install pv
RUN apt-get update; \
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Supplement to original file
#
FROM nginx:1.27-alpine3.19
FROM nginx:1.27-alpine3.20

RUN apk add --no-cache openssl

Expand Down
19 changes: 13 additions & 6 deletions dockerfiles/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
FROM php:8.1-fpm-alpine3.20
FROM php:8.2-fpm-alpine3.20

ENV XDEBUG_VERSION=3.1.4
ENV XDEBUG_VERSION=3.3.2
ENV IMAGICK_VERSION=3.7.0

##################################
# Adding WP-CLI #
##################################
# https://hub.docker.com/_/wordpress
COPY --from=wordpress:cli-2.10-php8.1 /usr/local/bin/wp /usr/local/bin/wp
COPY --from=wordpress:cli-2.11-php8.2 /usr/local/bin/wp /usr/local/bin/wp

##################################
# Persistent dependencies #
##################################
RUN set -eux; \
apk update; \
apk add --no-cache \
bash \
# Ghostscript is required for rendering PDF previews
Expand All @@ -39,13 +40,16 @@ RUN set -ex; \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libavif-dev \
aom-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
--with-avif \
; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
Expand All @@ -54,9 +58,12 @@ RUN set -ex; \
intl \
mysqli \
zip \
; \
# Install Xdebug see https://xdebug.org/docs/install
; \
apk update; \
# Install Xdebug see https://xdebug.org/docs/install \
apk add --no-cache linux-headers autoconf make g++; \
pecl install xdebug-${XDEBUG_VERSION}; \
apk del autoconf make g++ linux-headers; \
#
# WARNING: imagick is likely not supported on Alpine: https://github.com/Imagick/imagick/issues/328
# https://pecl.php.net/package/imagick
Expand Down Expand Up @@ -97,7 +104,7 @@ RUN mkdir -p /var/log/wordpress
##################################
RUN mkdir /docker-entrypoint.d

COPY docker-entrypoint.sh /
COPY docker-entrypoint.sh /docker-entrypoint.sh
COPY ./docker-entrypoint.d/* /docker-entrypoint.d

RUN chmod +x /docker-entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion sh/env/.env.secret.template
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ WP_DB_CHARSET=utf8mb4
# Default admin for WorPress installation
WP_ADMIN_USER=admin
[email protected]
#WP_ADMIN_PASSWORD will be generated in installation script
WP_ADMIN_PASSWORD=generate_this_pass

# Authentication unique keys and salts
WP_AUTH_KEY='generate_key'
Expand Down
2 changes: 1 addition & 1 deletion sh/npm-watch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ source ./sh/utils/colors
source ./.env

# Run watch in theme folder
docker compose -f docker-compose.build.yml run --rm node su -c "\
docker compose -f docker-compose.build.yml run --service-ports --rm node su -c "\
npm run watch --prefix ./wp-content/themes/${WP_DEFAULT_THEME}" \
"${DEFAULT_USER}"
5 changes: 2 additions & 3 deletions sh/wp-cli/core-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ if [ -z "$WP_HOME" ]; then
echo -e "${LIGHTRED}[Error]${NOCOLOR} WP_HOME is not defined in wp-config.php"; exit 1;
fi

WP_ADMIN_PASSWORD=$(tr -dc 'A-Za-z0-9_' </dev/urandom | head -c 25)

# Use WP_HOME, WP_ADMIN_USER, WP_ADMIN_EMAIL from .env
# Using WP_HOME, WP_ADMIN_USER, WP_ADMIN_EMAIL, WP_ADMIN_PASSWORD from .env.secret file
# Run the wp core install command and capture its output in a variable
wp core install \
--url="$WP_HOME" \
Expand All @@ -33,4 +31,5 @@ wp rewrite structure '/%postname%/' --hard

echo -e "${LIGHTGREEN}[Success]${NOCOLOR} Admin username: ${LIGHTYELLOW}$WP_ADMIN_USER${NOCOLOR}"
echo -e "${LIGHTGREEN}[Success]${NOCOLOR} Admin password: ${LIGHTYELLOW}$WP_ADMIN_PASSWORD${NOCOLOR}"
echo -e "${CYAN}[Info]${NOCOLOR} You can find this credentials in 'config/environment/.env.secret' file"
echo -e "${LIGHTYELLOW}[Warning]${NOCOLOR} Store your password in safe place"

0 comments on commit 25d8f42

Please sign in to comment.