Compare commits

...

14 Commits

Author SHA1 Message Date
d3e8812347
Move from apache2 to caddy + php-fpm (#1) 2025-01-06 21:48:59 +04:00
b9bd2d5951
Update phpbb to 3.3.14 2024-11-24 05:42:10 +04:00
3a8da97e59
Update phpbb to 3.3.13 2024-10-25 21:41:43 +04:00
83e13e08fb
Update phpbb to 3.3.12 2024-06-16 00:44:01 +04:00
a4604d0653
Update phpbb to 3.3.11 2023-10-27 03:13:47 +04:00
0e341f8927
Update README 2023-10-03 15:17:30 +04:00
fef2de8311
Fix wrong sha256 checksum for phpbb archive 2023-10-03 15:13:32 +04:00
c1528c7730
Try to update phpbb to 3.3.10 2023-10-03 15:10:39 +04:00
Dmitry Seleznyov
cc51a92d23
Merge pull request #11 from selim13/dependabot/github_actions/docker/setup-qemu-action-3
Bump docker/setup-qemu-action from 2 to 3
2023-09-14 16:23:40 +03:00
dependabot[bot]
f6a0e6f1a8
Bump docker/setup-qemu-action from 2 to 3
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-14 13:23:30 +00:00
Dmitry Seleznyov
0cfd792018
Merge pull request #13 from selim13/dependabot/github_actions/docker/metadata-action-5
Bump docker/metadata-action from 4 to 5
2023-09-14 16:23:29 +03:00
Dmitry Seleznyov
e3248b6a01
Merge pull request #12 from selim13/dependabot/github_actions/docker/login-action-3
Bump docker/login-action from 2 to 3
2023-09-14 16:23:19 +03:00
dependabot[bot]
5944787d6d
Bump docker/metadata-action from 4 to 5
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](https://github.com/docker/metadata-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 21:16:00 +00:00
dependabot[bot]
456101b7b8
Bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 21:15:53 +00:00
22 changed files with 226 additions and 268 deletions

View File

@ -1,2 +1,3 @@
.secrets .secrets
.act .act
examples

View File

@ -16,17 +16,17 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v2 - uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3 - uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Container registry - name: Login to Container registry
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
@ -34,7 +34,7 @@ jobs:
- name: Docker meta - name: Docker meta
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
tags: | tags: |
type=ref,event=branch type=ref,event=branch

5
.gitignore vendored
View File

@ -1 +1,4 @@
.secrets pkg
.secrets
.idea
.vscode

View File

@ -1,65 +1,80 @@
FROM alpine:3.17 # Install Caddy
FROM docker.io/caddy:builder-alpine AS caddy-builder
RUN xcaddy build
LABEL maintainer="selim013@gmail.com"
# Install PHP
FROM docker.io/alpine
LABEL maintainer="vladimir@hodakov.me"
# Setup document root
WORKDIR /var/www/html
# Get caddy
COPY --from=caddy-builder /usr/bin/caddy /usr/bin/caddy
# Install packages and remove default server definition
RUN apk add --no-cache curl \ RUN apk add --no-cache curl \
imagemagick \ imagemagick \
apache2 \ php84 \
php81 \ php84-fpm \
php81-apache2 \ php84-apache2 \
php81-ctype \ php84-ctype \
php81-curl \ php84-curl \
php81-dom \ php84-dom \
php81-ftp \ php84-ftp \
php81-gd \ php84-gd \
php81-iconv \ php84-iconv \
php81-json \ php84-json \
php81-mbstring \ php84-mbstring \
php81-mysqli \ php84-mysqli \
php81-opcache \ php84-opcache \
php81-openssl \ php84-openssl \
php81-pgsql \ php84-pgsql \
php81-sqlite3 \ php84-sqlite3 \
php81-tokenizer \ php84-tokenizer \
php81-xml \ php84-xml \
php81-zlib \ php84-zlib \
php81-zip \ php84-zip \
su-exec supervisor
### phpBB # Configure Caddy
ENV PHPBB_VERSION 3.3.9 COPY config/Caddyfile /etc/caddy/Caddyfile
ENV PHPBB_SHA256 8eacc10caff2327d51019ed2677b55ff1afdc68a3a7aaeee9ac29747775fe04f
# Configure PHP-FPM
COPY config/fpm-pool.conf /etc/php84/php-fpm.d/www.conf
COPY config/php.ini /etc/php84/conf.d/custom.ini
# Configure supervisord
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN mkdir /.config /phpbb
# Add tests app installation
COPY src/ /var/www/html/
# Add phpBB installation
ENV PHPBB_VERSION=3.3.14
ENV PHPBB_SHA256=68cd6cf3faefa175ea3892ba02c6b112e8967ed33703521c79820e35bd15ec9a
WORKDIR /tmp WORKDIR /tmp
RUN curl -SL https://download.phpbb.com/pub/release/3.3/${PHPBB_VERSION}/phpBB-${PHPBB_VERSION}.tar.bz2 -o phpbb.tar.bz2 \ RUN curl -SL https://download.phpbb.com/pub/release/3.3/${PHPBB_VERSION}/phpBB-${PHPBB_VERSION}.tar.bz2 -o phpbb.tar.bz2 \
&& echo "${PHPBB_SHA256} phpbb.tar.bz2" | sha256sum -c - \ && echo "${PHPBB_SHA256} phpbb.tar.bz2" | sha256sum -c - \
&& tar -xjf phpbb.tar.bz2 \ && tar -xjf phpbb.tar.bz2 \
&& mkdir /phpbb \
&& mkdir /phpbb/sqlite \ && mkdir /phpbb/sqlite \
&& mv phpBB3 /phpbb/www \ && mv phpBB3 /phpbb/www \
&& rm -f phpbb.tar.bz2 && rm -f phpbb.tar.bz2
COPY phpbb/config.php /phpbb/www COPY phpbb/config.php /phpbb/www
### Server # Expose the ports Caddy is reachable on
RUN mkdir -p /run/apache2 /phpbb/opcache \ EXPOSE 8080
&& chown apache:apache /run/apache2 /phpbb/opcache EXPOSE 8181
COPY apache2/httpd.conf /etc/apache2/
COPY apache2/conf.d/* /etc/apache2/conf.d/
COPY php/php.ini php/php-cli.ini /etc/php81/
COPY php/conf.d/* /etc/php81/conf.d
COPY start.sh /usr/local/bin/
RUN chown -R apache:apache /phpbb
WORKDIR /phpbb/www WORKDIR /phpbb/www
#VOLUME /phpbb/sqlite
#VOLUME /phpbb/www/files
#VOLUME /phpbb/www/store
#VOLUME /phpbb/www/images/avatars/upload
ENV PHPBB_INSTALL= \ ENV PHPBB_INSTALL= \
PHPBB_DB_DRIVER=sqlite3 \ PHPBB_DB_DRIVER=sqlite3 \
PHPBB_DB_HOST=/phpbb/sqlite/sqlite.db \ PHPBB_DB_HOST=/phpbb/sqlite/sqlite.db \
@ -73,5 +88,8 @@ ENV PHPBB_INSTALL= \
PHPBB_DEBUG= \ PHPBB_DEBUG= \
PHPBB_DEBUG_CONTAINER= PHPBB_DEBUG_CONTAINER=
EXPOSE 80 COPY start.sh /usr/local/bin/
CMD ["start.sh"] CMD ["start.sh"]
# Configure a healthcheck to validate that everything is up and running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping

View File

@ -1,6 +1,7 @@
MIT License MIT License
Copyright (c) 2016 Seleznyov Dmitry Copyright (c) 2016 Seleznyov Dmitry
Copyright (c) 2023-2025 Vladimir Hodakov
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,25 +1,29 @@
# phpBB3 docker image # phpBB3 docker image
This is updated fork of [selim13's docker-phpbb image](https://github.com/selim13/docker-phpbb).
Now it even bundles caddy instead of apache2. Thanks
[ParaParty/docker-php-caddy](https://github.com/ParaParty/docker-php-caddy) for the inspiration.
Lightweight, Alpine based [phpBB](https://www.phpbb.com/) docker image. Lightweight, Alpine based [phpBB](https://www.phpbb.com/) docker image.
# Supported tags and respective `Dockerfile` links # Supported tags and respective `Dockerfile` links
- [`3.3`, `3.3.4`, `latest`](https://github.com/selim13/docker-phpbb/blob/master/Dockerfile) bundled with PHP 8 - [`3.3`, `3.3.11`, `latest`](https://github.com/fat0troll/docker-phpbb/blob/master/Dockerfile) bundled with PHP 8
- [`3.2`, `3.2.11`](https://github.com/selim13/docker-phpbb/blob/3.2-alpine-apache/Dockerfile) bundled with PHP 7.2
# How to use this image # How to use this image
## Initial installation ## Initial installation
If you don't have a prepared phpBB database, you can use a standard phpBB If you don't have a prepared phpBB database, you can use a standard phpBB
installer script, just run a temporary container with `PHPBB_INSTALL=true` installer script, just run a temporary container with `PHPBB_INSTALL=true`
environment variable: environment variable:
```console ```console
$ docker run -p 8000:80 --name phpbb-install -e PHPBB_INSTALL=true -d selim13/phpbb:3.3 $ docker run -p 8000:8181 --name phpbb-install -e PHPBB_INSTALL=true -d fat0troll/phpbb:3.3
``` ```
Point your browser to the http://localhost:8000 to begin the Point your browser to the http://localhost:8000 to begin the
installation process. installation process.
This image is bundled with SQLite3, MySQL and PostgresSQL database engines This image is bundled with SQLite3, MySQL and PostgresSQL database engines
@ -31,7 +35,7 @@ For SQLite3 set `Database server hostname or DSN` field to `/phpbb/sqlite/sqlite
This file will be created on a docker volume and outside of the webserver's document root This file will be created on a docker volume and outside of the webserver's document root
for security. Leave user name, password and database name fields blank. for security. Leave user name, password and database name fields blank.
After the installation process is complete you can safely stop this container: After the installation process is complete you can safely stop this container:
```console ```console
$ docker stop phpbb-install $ docker stop phpbb-install
@ -41,9 +45,8 @@ $ docker stop phpbb-install
You can start a container as follows: You can start a container as follows:
```console ```console
$ docker run --name phpbb -d selim13/phpbb:3.3 $ docker run --name phpbb -d fat0troll/phpbb:3.3
``` ```
By default, it uses SQLite3 as a database backend, so you will need to supply By default, it uses SQLite3 as a database backend, so you will need to supply
@ -52,7 +55,7 @@ it with a database file. It's default path is `/phpbb/sqlite/sqlite.db`.
You can import it from the temporary installation container above: You can import it from the temporary installation container above:
```console ```console
$ docker run --volumes-from phpbb-install --name phpbb -d selim13/phpbb:3.3 $ docker run --volumes-from phpbb-install --name phpbb -d fat0troll/phpbb:3.3
``` ```
Or just copy it inside container if you have one from previous phpBB Or just copy it inside container if you have one from previous phpBB
@ -75,19 +78,21 @@ $ docker run --name phpbb \
-e PHPBB_DB_PASSWD=pass -d selim13/phpbb:3.3 -e PHPBB_DB_PASSWD=pass -d selim13/phpbb:3.3
``` ```
## Environment variables ## Environment variables
This image utilises environment variables for basic configuration. Most of This image utilises environment variables for basic configuration. Most of
them are passed directly to phpBB's `config.php` or to the startup script. them are passed directly to phpBB's `config.php` or to the startup script.
### PHPBB_INSTALL ### PHPBB_INSTALL
If set to `true`, container will start with an empty `config.php` file and If set to `true`, container will start with an empty `config.php` file and
phpBB `/install/` directory intact. This will allow you to initilalize phpBB `/install/` directory intact. This will allow you to initilalize
a forum database upon fresh installation. a forum database upon fresh installation.
### PHPBB_DB_DRIVER ### PHPBB_DB_DRIVER
Selects a database driver. phpBB3 ships with following drivers: Selects a database driver. phpBB3 ships with following drivers:
- `mssql` - MS SQL Server - `mssql` - MS SQL Server
- `mysql` - MySQL via outdated php extension - `mysql` - MySQL via outdated php extension
- `mysqli` - MySQL via newer php extension - `mysqli` - MySQL via newer php extension
@ -99,15 +104,15 @@ Selects a database driver. phpBB3 ships with following drivers:
This image is bundled with support of `sqlite3`, `mysqli` and `postgres` drivers. This image is bundled with support of `sqlite3`, `mysqli` and `postgres` drivers.
Default value: sqlite3 Default value: sqlite3
### PHPBB_DB_HOST ### PHPBB_DB_HOST
Database hostname or ip address. Database hostname or ip address.
For the SQLite3 driver sets database file path. For the SQLite3 driver sets database file path.
Default value: /phpbb/sqlite/sqlite.db Default value: /phpbb/sqlite/sqlite.db
### PHPBB_DB_PORT ### PHPBB_DB_PORT
Database port. Database port.
@ -132,7 +137,7 @@ or by extending this image.
Table prefix for phpBB3 database. Table prefix for phpBB3 database.
Default value: phpbb_ Default value: phpbb\_
### PHPBB_DB_AUTOMIGRATE ### PHPBB_DB_AUTOMIGRATE
@ -142,6 +147,7 @@ executing `bin/phpbbcli.php db:migrate` on every startup.
If migrations fail, container will refuse to start. If migrations fail, container will refuse to start.
### PHPBB_DB_WAIT ### PHPBB_DB_WAIT
If set to `true`, container will wait for database service to become available. If set to `true`, container will wait for database service to become available.
You will need to explicitly set `PHPBB_DB_HOST` and `PHPBB_DB_PORT` for this You will need to explicitly set `PHPBB_DB_HOST` and `PHPBB_DB_PORT` for this
to work. to work.
@ -149,7 +155,7 @@ to work.
Use in conjunction with `PHPBB_DB_AUTOMIGRATE` to prevent running migrations Use in conjunction with `PHPBB_DB_AUTOMIGRATE` to prevent running migrations
before database is ready. before database is ready.
Won't work for SQLite database engine as it is always available. Won't work for SQLite database engine as it is always available.
### PHPBB_DISPLAY_LOAD_TIME ### PHPBB_DISPLAY_LOAD_TIME
@ -161,10 +167,11 @@ usage at the bottom of the page.
If set to `true`, enables phpBB debug mode. If set to `true`, enables phpBB debug mode.
### PHPBB_DEBUG_CONTAINER ### PHPBB_DEBUG_CONTAINER
## Volumes ## Volumes
By default there are four volumes created for each container: By default there are four volumes created for each container:
- /phpbb/sqlite - /phpbb/sqlite
- /phpbb/www/files - /phpbb/www/files
- /phpbb/www/store - /phpbb/www/store
@ -173,12 +180,12 @@ By default there are four volumes created for each container:
# Additional configuration # Additional configuration
This image is based on a stock official Alpine image with apache2 and php5 This image is based on a stock official Alpine image with apache2 and php5
packages from the Alpine Linux repository, so you can drop their custom packages from the Alpine Linux repository, so you can drop their custom
configuration files to `/etc/apache2/conf.d` and `/etc/php5/conf.d`. configuration files to `/etc/apache2/conf.d` and `/etc/php5/conf.d`.
## Pass user's IP from proxy ## Pass user's IP from proxy
If you are planning to start a container behind proxy If you are planning to start a container behind proxy
(like [nginx-proxy](https://github.com/jwilder/nginx-proxy)), it will probably (like [nginx-proxy](https://github.com/jwilder/nginx-proxy)), it will probably
be a good idea to get user's real IP instead of proxy one. For this, you can use be a good idea to get user's real IP instead of proxy one. For this, you can use
Apache RemoteIP module. Create a configuration file: Apache RemoteIP module. Create a configuration file:
@ -200,4 +207,4 @@ image:
FROM selim13/phpbb:3.3 FROM selim13/phpbb:3.3
COPY remoteip.conf /etc/apache2/conf.d COPY remoteip.conf /etc/apache2/conf.d
``` ```

View File

@ -1,9 +0,0 @@
PidFile "/run/apache2/httpd.pid"
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 250
MaxConnectionsPerChild 0
</IfModule>

View File

@ -1,155 +0,0 @@
ServerTokens Prod
ServerRoot /var/www
Listen 80
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_socache_module modules/mod_authn_socache.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
#LoadModule authz_dbd_module modules/mod_authz_dbd.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_form_module modules/mod_auth_form.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule allowmethods_module modules/mod_allowmethods.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cache_disk_module modules/mod_cache_disk.so
#LoadModule cache_socache_module modules/mod_cache_socache.so
#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
#LoadModule socache_dbm_module modules/mod_socache_dbm.so
#LoadModule socache_memcache_module modules/mod_socache_memcache.so
#LoadModule watchdog_module modules/mod_watchdog.so
#LoadModule macro_module modules/mod_macro.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule dumpio_module modules/mod_dumpio.so
#LoadModule echo_module modules/mod_echo.so
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule data_module modules/mod_data.so
#LoadModule ratelimit_module modules/mod_ratelimit.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule request_module modules/mod_request.so
#LoadModule include_module modules/mod_include.so
LoadModule filter_module modules/mod_filter.so
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_debug_module modules/mod_log_debug.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
#LoadModule remoteip_module modules/mod_remoteip.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
#LoadModule dialup_module modules/mod_dialup.so
#LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
LoadModule unixd_module modules/mod_unixd.so
#LoadModule heartbeat_module modules/mod_heartbeat.so
#LoadModule heartmonitor_module modules/mod_heartmonitor.so
LoadModule status_module modules/mod_status.so
#LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule asis_module modules/mod_asis.so
#LoadModule info_module modules/mod_info.so
#LoadModule suexec_module modules/mod_suexec.so
<IfModule !mpm_prefork_module>
#LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
#LoadModule cgi_module modules/mod_cgi.so
</IfModule>
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
#LoadModule actions_module modules/mod_actions.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule negotiation_module modules/mod_negotiation.so
<IfModule unixd_module>
User apache
Group apache
</IfModule>
ServerAdmin you@example.com
ServerSignature Off
#ServerName www.example.com:80
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/phpbb/www"
<Directory "/phpbb/www">
Options FollowSymLinks
AllowOverride All
Require all granted
# Return 404 for all dot files (.htaccess, .git, etc...)
RedirectMatch 404 /\..*$
</Directory>
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog /dev/stderr
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog /dev/stdout combined
</IfModule>
<IfModule mime_module>
TypesConfig /etc/apache2/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
<IfModule mime_magic_module>
MIMEMagicFile /etc/apache2/magic
</IfModule>
IncludeOptional /etc/apache2/conf.d/*.conf

23
config/Caddyfile Normal file
View File

@ -0,0 +1,23 @@
:8080 {
root * /var/www/html/public
php_fastcgi unix//run/php-fpm.sock {
trusted_proxies private_ranges
}
file_server
log stdout
}
:8181 {
root * /phpbb/www
php_fastcgi unix//run/php-fpm.sock {
trusted_proxies private_ranges
}
file_server
log stdout
}

56
config/fpm-pool.conf Normal file
View File

@ -0,0 +1,56 @@
[global]
; Log to stderr
error_log = /dev/stderr
[www]
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /run/php-fpm.sock
; Enable status page
pm.status_path = /fpm-status
; Ondemand process manager
pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 100
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 1000
; Make sure the FPM workers can reach the environment variables for configuration
clear_env = no
; Catch output from PHP
catch_workers_output = yes
; Remove the 'child 10 said into stderr' prefix in the log and only show the actual message
decorate_workers_output = no
; Enable ping page to use in healthcheck
ping.path = /fpm-ping

2
config/php.ini Normal file
View File

@ -0,0 +1,2 @@
[Date]
date.timezone="UTC"

24
config/supervisord.conf Normal file
View File

@ -0,0 +1,24 @@
[supervisord]
nodaemon=true
user=root
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/supervisord.pid
[program:php-fpm]
command=php-fpm84 -F -R
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
[program:caddy]
command=caddy run --config /etc/caddy/Caddyfile
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0

12
docker-compose.test.yml Normal file
View File

@ -0,0 +1,12 @@
version: '3.5'
services:
app:
image: ${IMAGE_NAME}:${IMAGE_TAG}
build: .
sut:
image: alpine:3.13
depends_on:
- app
command: /tmp/run_tests.sh
volumes:
- "./run_tests.sh:/tmp/run_tests.sh:ro"

View File

@ -1,8 +0,0 @@
opcache.memory_consumption=64
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.validate_timestamps=0
opcache.revalidate_freq=0
opcache.fast_shutdown=1
opcache.enable_cli=1
opcache.file_cache=/phpbb/opcache

View File

@ -1,2 +0,0 @@
[php]
memory_limit = -1

View File

@ -1,18 +0,0 @@
[PHP]
file_uploads = On
max_file_uploads = 2
upload_max_filesize = 8M
post_max_size = 8M
allow_url_fopen = On
expose_php = Off
security.limit_extensions = .php
output_buffering = On
display_errors = Off
log_errors = On
error_log = /dev/stderr
[Date]
date.timezone = 'UTC'

3
run_tests.sh Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
apk --no-cache add curl
curl --silent --fail http://app:8080 | grep 'PHP 8.1'

2
src/public/index.php Normal file
View File

@ -0,0 +1,2 @@
<?php
phpinfo();

1
src/public/test.html Normal file
View File

@ -0,0 +1 @@
This static HTML file is served by Caddy

View File

@ -17,11 +17,8 @@ db_wait() {
db_migrate() { db_migrate() {
if [[ "${PHPBB_DB_AUTOMIGRATE}" = "true" && "${PHPBB_INSTALL}" != "true" ]]; then if [[ "${PHPBB_DB_AUTOMIGRATE}" = "true" && "${PHPBB_INSTALL}" != "true" ]]; then
echo "$(date) - applying migrations" echo "$(date) - applying migrations"
su-exec apache php bin/phpbbcli.php db:migrate php84 bin/phpbbcli.php db:migrate
fi fi
} }
# Apache gets grumpy about PID files pre-existing db_wait && db_migrate && exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
rm -f /run/apache2/httpd.pid
db_wait && db_migrate && exec httpd -DFOREGROUND "$@"