Enable additional PHP extensions

This commit is contained in:
3wc 2020-10-23 04:06:26 +02:00
parent c6039c3b54
commit 43cbfafb8a
6 changed files with 37 additions and 7 deletions

View File

@ -6,8 +6,13 @@ export DOMAIN=wordpress.example.com
#export EXTRA_DOMAINS=', `www.wordpress.example.com`'
export LETS_ENCRYPT_ENV=production
## Additional extensions
#export PHP_EXTENSIONS="calendar"
export DB_ROOT_PASSWORD_VERSION=v1
export DB_PASSWORD_VERSION=v1
export PHP_UPLOADS_CONF_VERSION=v1
export ENTRYPOINT_CONF_VERSION=v1
# Multisite
#export WORDPRESS_CONFIG_EXTRA="\

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
app:
entrypoint: /docker-entrypoint.sh
entrypoint: /docker-entrypoint.mailrelay.sh
environment:
- SMTP_HOST=${SMTP_HOST}
- MAIL_FROM=${MAIL_FROM}
@ -12,8 +12,8 @@ services:
configs:
- source: mstmp_conf
target: /etc/msmtprc
- source: entrypoint_conf
target: /docker-entrypoint.sh
- source: entrypoint_mailrelay_conf
target: /docker-entrypoint.mailrelay.sh
mode: 0555
networks:
@ -25,7 +25,7 @@ configs:
name: ${STACK_NAME}_mstmp_conf_${MSMTP_CONF_VERSION}
file: msmtp.conf.tmpl
template_driver: golang
entrypoint_conf:
entrypoint_mailrelay_conf:
name: ${STACK_NAME}_entrypoint_mailrelay_${ENTRYPOINT_MAILRELAY_CONF_VERSION}
file: entrypoint.mailrelay.sh.tmpl
template_driver: golang

View File

@ -15,8 +15,16 @@ services:
- WORDPRESS_DB_PASSWORD_FILE=/run/secrets/db_password
- WORDPRESS_DB_NAME=wordpress
- WORDPRESS_CONFIG_EXTRA=${WORDPRESS_CONFIG_EXTRA}
- PHP_EXTENSIONS
secrets:
- db_password
configs:
- source: php_uploads_conf
target: /usr/local/etc/php/conf.d/uploads.ini
- source: entrypoint_conf
target: /docker-entrypoint.sh
mode: 0555
entrypoint: /docker-entrypoint.sh
depends_on:
- db
healthcheck:
@ -73,3 +81,12 @@ secrets:
db_password:
external: true
name: ${STACK_NAME}_db_password_${DB_PASSWORD_VERSION}
configs:
entrypoint_conf:
name: ${STACK_NAME}_entrypoint_conf_${ENTRYPOINT_CONF_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
php_uploads_conf:
name: ${STACK_NAME}_php_uploads_conf_${PHP_UPLOADS_CONF_VERSION}
file: uploads.ini

View File

@ -4,6 +4,4 @@ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y msmtp && rm
echo "sendmail_path = /usr/bin/msmtp -t -i" > /usr/local/etc/php/conf.d/sendmail.ini
# Upstream ENTRYPOINT
# https://github.com/docker-library/wordpress/blob/master/php7.4/apache/Dockerfile#L120
/usr/local/bin/docker-entrypoint.sh apache2-foreground "$@"
/docker-entrypoint.sh "$@"

7
entrypoint.sh.tmpl Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
docker-php-ext-install {{ env "PHP_EXTENSIONS" }}
# Upstream ENTRYPOINT
# https://github.com/docker-library/wordpress/blob/master/php7.4/apache/Dockerfile#L120
/usr/local/bin/docker-entrypoint.sh apache2-foreground "$@"

3
uploads.ini Normal file
View File

@ -0,0 +1,3 @@
file_uploads = On
upload_max_filesize = 256M
post_max_size = 256M