Skip to content

Some improvements and implementations #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 24, 2019
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 .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sql linguist-detectable=false
6 changes: 3 additions & 3 deletions Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ RUN { \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini

# Calculate download URL
ENV VERSION %%VERSION%%
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ RUN { \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini

# Calculate download URL
ENV VERSION %%VERSION%%
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Official phpMyAdmin Docker image

Run phpMyAdmin with Alpine, supervisor, nginx and PHP FPM.
Run phpMyAdmin with Alpine, Apache and PHP FPM.

[![Build Status](https://travis-ci.org/phpmyadmin/docker.svg?branch=master)](https://travis-ci.org/phpmyadmin/docker)
[![Docker Pulls](https://img.shields.io/docker/pulls/phpmyadmin/phpmyadmin.svg)][hub]
Expand Down Expand Up @@ -125,6 +125,7 @@ Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma
* ``PMA_USER`` and ``PMA_PASSWORD`` - define username to use for config authentication method
* ``PMA_ABSOLUTE_URI`` - define user-facing URI
* ``HIDE_PHP_VERSION`` - if defined, will hide the php version (`expose_php = Off`). Set to any value (such as HIDE_PHP_VERSION=true).
* ``UPLOAD_LIMIT`` - if set, will override the default value for apache and php-fpm (default value is 2048 kb)

For usage with Docker secrets, appending ``_FILE`` to any environment variable is allowed:
```
Expand Down
6 changes: 3 additions & 3 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ RUN { \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini

# Calculate download URL
ENV VERSION 4.9.2
Expand Down
16 changes: 14 additions & 2 deletions apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
group="$(id -g)"
fi

chown www-data:www-data /sessions /var/nginx/client_body_temp
# Custom folders for sessions
chown ${user}:${group} /sessions /var/nginx/client_body_temp

if ! [ -e index.php -a -e db_designer.php ]; then
if ! [ -e index.php -a -e url.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
Expand Down Expand Up @@ -52,4 +53,15 @@ if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo 'expose_php = Off' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi

UPLOAD_LIMIT_INI_FILE="$PHP_INI_DIR/conf.d/phpmyadmin-upload-limit.ini"
if [ ! -z "${UPLOAD_LIMIT}" ]; then
echo "Adding the custom upload limit."
echo -e "upload_max_filesize = $UPLOAD_LIMIT\npost_max_size = $UPLOAD_LIMIT\n" > $UPLOAD_LIMIT_INI_FILE
else
if [ -f $UPLOAD_LIMIT_INI_FILE ]; then
echo "Removing the custom upload limit."
rm $UPLOAD_LIMIT_INI_FILE
fi
fi

exec "$@"
11 changes: 9 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
group="$(id -g)"
fi

chown www-data:www-data /sessions /var/nginx/client_body_temp
# Custom folders for sessions
chown ${user}:${group} /sessions /var/nginx/client_body_temp

if ! [ -e index.php -a -e db_designer.php ]; then
if ! [ -e index.php -a -e url.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
Expand Down Expand Up @@ -52,4 +53,10 @@ if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi

UPLOAD_LIMIT_INI_FILE="$PHP_INI_DIR/conf.d/phpmyadmin-upload-limit.ini"
if [ ! -z "${UPLOAD_LIMIT}" ]; then
echo "Adding the custom upload limit."
echo -e "upload_max_filesize = $UPLOAD_LIMIT\npost_max_size = $UPLOAD_LIMIT\n" > $UPLOAD_LIMIT_INI_FILE
fi

exec "$@"
6 changes: 3 additions & 3 deletions fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ RUN { \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini

# Calculate download URL
ENV VERSION 4.9.2
Expand Down
16 changes: 14 additions & 2 deletions fpm-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
group="$(id -g)"
fi

chown www-data:www-data /sessions /var/nginx/client_body_temp
# Custom folders for sessions
chown ${user}:${group} /sessions /var/nginx/client_body_temp

if ! [ -e index.php -a -e db_designer.php ]; then
if ! [ -e index.php -a -e url.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
Expand Down Expand Up @@ -52,4 +53,15 @@ if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo 'expose_php = Off' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi

UPLOAD_LIMIT_INI_FILE="$PHP_INI_DIR/conf.d/phpmyadmin-upload-limit.ini"
if [ ! -z "${UPLOAD_LIMIT}" ]; then
echo "Adding the custom upload limit."
echo -e "upload_max_filesize = $UPLOAD_LIMIT\npost_max_size = $UPLOAD_LIMIT\n" > $UPLOAD_LIMIT_INI_FILE
else
if [ -f $UPLOAD_LIMIT_INI_FILE ]; then
echo "Removing the custom upload limit."
rm $UPLOAD_LIMIT_INI_FILE
fi
fi

exec "$@"
6 changes: 3 additions & 3 deletions fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ RUN { \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini

# Calculate download URL
ENV VERSION 4.9.2
Expand Down
16 changes: 14 additions & 2 deletions fpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
group="$(id -g)"
fi

chown www-data:www-data /sessions /var/nginx/client_body_temp
# Custom folders for sessions
chown ${user}:${group} /sessions /var/nginx/client_body_temp

if ! [ -e index.php -a -e db_designer.php ]; then
if ! [ -e index.php -a -e url.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
Expand Down Expand Up @@ -52,4 +53,15 @@ if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo 'expose_php = Off' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi

UPLOAD_LIMIT_INI_FILE="$PHP_INI_DIR/conf.d/phpmyadmin-upload-limit.ini"
if [ ! -z "${UPLOAD_LIMIT}" ]; then
echo "Adding the custom upload limit."
echo -e "upload_max_filesize = $UPLOAD_LIMIT\npost_max_size = $UPLOAD_LIMIT\n" > $UPLOAD_LIMIT_INI_FILE
else
if [ -f $UPLOAD_LIMIT_INI_FILE ]; then
echo "Removing the custom upload limit."
rm $UPLOAD_LIMIT_INI_FILE
fi
fi

exec "$@"