Add SQLite and PDO support

pull/64/head
jowi 7 years ago
parent ec2cc0041e
commit 39dca79879

@ -1,19 +1,19 @@
FROM php:7.0-apache
# Install required PHP extensions
RUN buildDeps='libpq-dev' \
RUN buildDeps='libpq-dev libsqlite3-dev' \
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps \
&& docker-php-ext-install mysqli pgsql \
&& docker-php-ext-install mysqli pdo pdo_mysql pdo_pgsql pdo_sqlite pgsql \
&& apt-mark manual libpq5 \
&& apt-get purge -y --auto-remove $buildDeps \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
VOLUME /var/www/html
ENV POSTFIXADMIN_VERSION 3.1
ENV POSTFIXADMIN_SHA512 3bda4e9d4a7308d22edca30d181af76b7153e57b19bda878e32f5eeeb49127f46581c966706bcca13cd31740cadacc584e15830aa157b4655e60d44d66f45ddd
RUN set -eux; \
RUN set -eu; \
curl -o postfixadmin.tar.gz -SL "https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-${POSTFIXADMIN_VERSION}.tar.gz"; \
echo "$POSTFIXADMIN_SHA512 *postfixadmin.tar.gz" | sha512sum -c -; \
# upstream tarball include ./postfixadmin-postfixadmin-${POSTFIXADMIN_VERSION}/

@ -32,6 +32,14 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
: "${POSTFIXADMIN_DB_NAME:=${MYSQL_ENV_MYSQL_DATABASE:postfix}}"
fi
if [ "$POSTFIXADMIN_DB_TYPE" = 'sqlite' ]; then
: "${POSTFIXADMIN_DB_NAME:=/var/local/postfixadmin.db}"
if [ ! -e "$POSTFIXADMIN_DB_NAME" ]; then
touch $POSTFIXADMIN_DB_NAME
fi
fi
if [ ! -e config.local.php ]; then
touch config.local.php
echo "Write config to $PWD/config.local.php"

Loading…
Cancel
Save