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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- "abc-base:8.3"
- "abc-base:8.4"
- "abc-base:8.4-frankenphp"
- "abc-base:8.5"
arch:
- amd64
- arm64
Expand Down
101 changes: 101 additions & 0 deletions abc-base/8.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
FROM php:8.5-fpm-trixie

# Install dependencies and PHP extensions.
COPY ./apt /etc/apt
RUN set -x \
# Setup the nginx debian repo.
&& VERSION_CODENAME="$(awk -F= '/^VERSION_CODENAME=/ { print $2 }' /etc/os-release)" \
&& echo "deb [signed-by=/etc/apt/nginx-archive-keyring.gpg] http://nginx.org/packages/mainline/debian $VERSION_CODENAME nginx" > /etc/apt/sources.list.d/nginx.list \
# Symlink supervisord config.
&& ln -s /usr/local/etc/supervisord.conf /etc/ \
# Web-writable state directory and nginx listener directory.
&& install -d -o www-data -g www-data /run/www /run/listen \
# Empty default crontab.
&& touch /etc/crontab \
# Run-time dependencies.
&& apt-get update \
&& apt-get install -y --no-install-recommends \
libgd3 \
libgmpxx4ldbl \
libicu76 \
libmemcached11 \
libmemcachedutil2 \
libpq5 \
libzip5 \
nginx \
tini \
unzip \
zlib1g \
supervisor \
jq \
pwgen \
default-mysql-client \
vim \
&& savedAptMark="$(apt-mark showmanual)" \
# Build-time dependencies.
&& apt-get install -y --no-install-recommends \
icu-devtools \
libgd-dev \
libgmp-dev \
libicu-dev \
libldap2-dev \
libmemcached-dev \
libonig-dev \
libpq-dev \
libsqlite3-dev \
libzip-dev \
zlib1g-dev \
# Build PHP extensions.
&& docker-php-ext-configure gd \
--with-external-gd \
&& docker-php-ext-configure zip \
--with-zip \
&& docker-php-ext-configure pdo_mysql \
&& docker-php-ext-install \
exif \
gd \
gettext \
gmp \
intl \
ldap \
mbstring \
pcntl \
pdo_mysql \
pdo_pgsql \
pdo_sqlite \
zip \
&& pecl install \
memcached \
redis \
&& docker-php-ext-enable \
memcached \
redis \
# Cleanup.
&& apt-mark auto '.*' > /dev/null \
&& apt-mark manual $savedAptMark > /dev/null \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -r \
/var/lib/apt/lists/* \
/tmp/pear \
# Remove PHP FPM config, because we'll replace it.
&& rm -fr /usr/local/etc/php-fpm.* \
# Ensure nginx directories are writable.
&& rm -fr /var/log/nginx /var/cache/nginx \
&& install -d -o www-data -g www-data /var/log/nginx /var/cache/nginx

# Copy Composer.
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

# Copy MinIO client.
COPY --from=minio/mc:latest /usr/bin/mc /usr/bin/mc

# Copy pocketcron.
COPY --from=ghcr.io/stephank/pocketcron /usr/bin/pocketcron /usr/bin/pocketcron

# Copy configuration files and scripts.
COPY usrlocal/ /usr/local/
COPY nginx/ /etc/nginx/

# Image configuration.
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["supervisord"]
Binary file added abc-base/8.5/apt/nginx-archive-keyring.gpg
Binary file not shown.
4 changes: 4 additions & 0 deletions abc-base/8.5/apt/preferences.d/99nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Package: *
Pin: origin nginx.org
Pin: release o=nginx
Pin-Priority: 900
16 changes: 16 additions & 0 deletions abc-base/8.5/nginx/abc_vhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is meant to be included in ABC Manager vhosts. It proxies *.php
# requests to PHP FPM, and sets up rewriting to index.php.

index index.php index.html;

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

location ~ \.php$ {
include fastcgi_params;

fastcgi_pass unix:/run/www/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
30 changes: 30 additions & 0 deletions abc-base/8.5/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
worker_processes 1;

error_log /dev/stderr warn;
pid /run/www/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

access_log /dev/stdout combined;

sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip_static on;
server_tokens off;

# Disable tasks handled by front proxies.
proxy_buffering off;
proxy_request_buffering off;
fastcgi_buffering off;
fastcgi_request_buffering off;
client_max_body_size 0;

include /etc/nginx/conf.d/*.conf;
}
19 changes: 19 additions & 0 deletions abc-base/8.5/usrlocal/bin/abc-link-shared
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
set -e

# Small helper that takes a list of docroot-relative paths, and sets them up as
# symlinks to the shared volume.
#
# By default, creates links in `/var/www/html` to `/shared`, but these can be
# overridden with the `PROJECT_ROOT` and `SHARED_ROOT` environment variables.
#
# Note that the `PROJECT_ROOT` paths are trashed.

SHARED_ROOT="${SHARED_ROOT:-/shared}"
PROJECT_ROOT="${PROJECT_ROOT:-/var/www/html}"

for f in "$@"; do
echo "${PROJECT_ROOT}/${f} -> ${SHARED_ROOT}/${f}"
rm -fr "${PROJECT_ROOT}/${f}"
ln -s "${SHARED_ROOT}/${f}" "${PROJECT_ROOT}/${f}"
done
16 changes: 16 additions & 0 deletions abc-base/8.5/usrlocal/etc/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[global]
daemonize = no
error_log = /proc/self/fd/2

[www]
listen = /run/www/php-fpm.sock

clear_env = no
catch_workers_output = yes
decorate_workers_output = no

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
4 changes: 4 additions & 0 deletions abc-base/8.5/usrlocal/etc/php/conf.d/docker-php-global.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
; Any global PHP configuration can be added here.

; Disable X-Powered-By header
expose_php = Off
40 changes: 40 additions & 0 deletions abc-base/8.5/usrlocal/etc/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[unix_http_server]
file=/run/www/supervisor.sock

[supervisord]
user=www-data
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/www/supervisor.pid

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///run/www/supervisor.sock


[program:php-fpm]
priority=200
command=php-fpm
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0

[program:nginx]
priority=300
command=nginx -g 'daemon off;'
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0

[program:cron]
priority=300
command=pocketcron /etc/crontab
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0
Loading