feat(): add PHP_EXTENSION env to install php extension

pull/59/head
Magicalex 2020-06-02 18:12:38 +02:00
parent cd55564193
commit 052b6cc755
No known key found for this signature in database
GPG Key ID: A89B48B1788C3CB5
2 changed files with 30 additions and 0 deletions

View File

@ -55,6 +55,7 @@
| **OPCACHE_MEMORY_LIMIT** | OPcache memory size in megabytes | *optional* | 128
| **LOG_TO_STDOUT** | Enable nginx and php error logs to stdout | *optional* | false
| **GITHUB_TOKEN_AUTH** | Github token to download private extensions | *optional* | false
| **PHP_EXTENSIONS** | Install additional php extensions | *optional* | none
### Required environment variable for first installation
@ -148,6 +149,26 @@ docker-compose up -d flarum
![flarum-home](http://i.imgur.com/6kH9iTV.png)
### Install additional php extensions
```yml
version: "3"
services:
flarum:
image: mondedie/flarum:stable
container_name: flarum
environment:
- PHP_EXTENSIONS="gmp session brotli"
volumes:
- /mnt/docker/flarum/assets:/flarum/app/public/assets
- /mnt/docker/flarum/extensions:/flarum/app/extensions
- /mnt/docker/flarum/nginx:/etc/nginx/conf.d
```
This example install php7-gmp php7-session and php7-brotli with apk
You can find a php extension here https://pkgs.alpinelinux.org/packages?name=php7-*&branch=v3.12&arch=x86_64
### Install custom extensions
**Flarum extensions list :** https://flagrow.io/extensions

View File

@ -31,6 +31,15 @@ if [ "${LOG_TO_STDOUT}" = true ]; then
sed -i "s/.*error_log.*$/error_log = \/dev\/stdout/" /etc/php7/php-fpm.conf
fi
# Install additional php extensions
if [ -n "${PHP_EXTENSIONS}" ]; then
for extension in ${PHP_EXTENSIONS}; do
PACKAGES="php7-${extension} ${PACKAGES}"
done
apk add --no-progress --no-cache ${PACKAGES}
fi
cd /flarum/app
# add github token authentication (eg. for privates extensions)