mirror of
https://github.com/phpmyadmin/docker.git
synced 2026-08-24 10:13:22 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a1cbfd6a3 | ||
|
|
25dde22ee9 | ||
|
|
f0ebd7aec5 | ||
|
|
98aa7b80c8 | ||
|
|
2d6fd72542 | ||
|
|
c706c520ef | ||
|
|
8269a39bfa | ||
|
|
c625c70fde | ||
|
|
2608fbd118 | ||
|
|
df45b3f76c | ||
|
|
edf7b2a375 | ||
|
|
b369d770dd | ||
|
|
e831e55d59 | ||
|
|
7a5f742d7d | ||
|
|
316a237509 | ||
|
|
44a266c45d | ||
|
|
2fe5947116 | ||
|
|
92a5a76a26 | ||
|
|
5dd9a0f015 | ||
|
|
f18aca104e | ||
|
|
d42e7c8a7d | ||
|
|
ca768f47fc | ||
|
|
93e2be73ec | ||
|
|
85198de04f | ||
|
|
c5d83d0fba | ||
|
|
d5f2f27d37 |
+2
-2
@@ -12,11 +12,11 @@ python:
|
||||
env:
|
||||
matrix:
|
||||
- DB=mysql:latest
|
||||
- DB=mariadb:latest
|
||||
- DB=mariadb:10.2
|
||||
|
||||
before_install:
|
||||
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
|
||||
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=$TESTSUITE_PASSWORD -d $DB
|
||||
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=$TESTSUITE_PASSWORD -v $PWD/testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro -d $DB
|
||||
|
||||
install:
|
||||
- pip install mechanize html5lib
|
||||
|
||||
+46
-35
@@ -1,7 +1,13 @@
|
||||
FROM php:7.2-fpm-alpine
|
||||
|
||||
RUN apk add --no-cache \
|
||||
nginx \
|
||||
supervisor
|
||||
|
||||
# Install dependencies
|
||||
RUN apk add --no-cache --virtual .build-deps \
|
||||
RUN set -ex; \
|
||||
\
|
||||
apk add --no-cache --virtual .build-deps \
|
||||
bzip2-dev \
|
||||
freetype-dev \
|
||||
libjpeg-turbo-dev \
|
||||
@@ -20,48 +26,53 @@ RUN apk add --no-cache --virtual .build-deps \
|
||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||
)"; \
|
||||
apk add --virtual .phpmyadmin-phpexts-rundeps $runDeps; \
|
||||
apk del .build-deps; \
|
||||
apk add --no-cache nginx supervisor
|
||||
|
||||
# Include keyring to verify download
|
||||
COPY phpmyadmin.keyring /
|
||||
|
||||
# Copy configuration
|
||||
COPY etc /etc/
|
||||
|
||||
# Copy main script
|
||||
COPY run.sh /run.sh
|
||||
RUN chmod u+rwx /run.sh
|
||||
apk del .build-deps
|
||||
|
||||
# Calculate download URL
|
||||
ENV VERSION 4.8.0
|
||||
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.gz
|
||||
ENV VERSION 4.8.2
|
||||
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
|
||||
LABEL version=$VERSION
|
||||
|
||||
# Download tarball, verify it using gpg and extract
|
||||
RUN set -x \
|
||||
&& GNUPGHOME="$(mktemp -d)" \
|
||||
&& export GNUPGHOME \
|
||||
&& apk add --no-cache curl gnupg \
|
||||
&& curl --output phpMyAdmin.tar.gz --location $URL \
|
||||
&& curl --output phpMyAdmin.tar.gz.asc --location $URL.asc \
|
||||
&& gpgv --keyring /phpmyadmin.keyring phpMyAdmin.tar.gz.asc phpMyAdmin.tar.gz \
|
||||
&& apk del --no-cache curl gnupg \
|
||||
&& rm -rf "$GNUPGHOME" \
|
||||
&& tar xzf phpMyAdmin.tar.gz \
|
||||
&& rm -f phpMyAdmin.tar.gz phpMyAdmin.tar.gz.asc \
|
||||
&& mv phpMyAdmin-$VERSION-all-languages /www \
|
||||
&& rm -rf /www/setup/ /www/examples/ /www/test/ /www/po/ /www/composer.json /www/RELEASE-DATE-$VERSION \
|
||||
&& sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /www/libraries/vendor_config.php \
|
||||
&& chown -R root:nobody /www \
|
||||
&& find /www -type d -exec chmod 750 {} \; \
|
||||
&& find /www -type f -exec chmod 640 {} \;
|
||||
|
||||
RUN set -ex; \
|
||||
apk add --no-cache --virtual .fetch-deps \
|
||||
gnupg \
|
||||
; \
|
||||
\
|
||||
export GNUPGHOME="$(mktemp -d)"; \
|
||||
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
|
||||
curl --output phpMyAdmin.tar.xz --location $URL; \
|
||||
curl --output phpMyAdmin.tar.xz.asc --location $URL.asc; \
|
||||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|
||||
|| gpg --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|
||||
|| gpg --keyserver keys.gnupg.net --recv-keys "$GPGKEY" \
|
||||
|| gpg --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|
||||
|| gpg --keyserver keyserver.pgp.com --recv-keys "$GPGKEY"; \
|
||||
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
|
||||
tar -xf phpMyAdmin.tar.xz; \
|
||||
gpgconf --kill all; \
|
||||
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
|
||||
mv phpMyAdmin-$VERSION-all-languages /www; \
|
||||
rm -rf /www/setup/ /www/examples/ /www/test/ /www/po/ /www/composer.json /www/RELEASE-DATE-$VERSION; \
|
||||
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /www/libraries/vendor_config.php; \
|
||||
chown -R nobody:nogroup /www; \
|
||||
find /www -type d -exec chmod 750 {} \; ; \
|
||||
find /www -type f -exec chmod 640 {} \; ; \
|
||||
# Add directory for sessions to allow session persistence
|
||||
RUN mkdir /sessions
|
||||
mkdir /sessions; \
|
||||
mkdir -p /www/tmp; \
|
||||
chmod -R 777 /www/tmp; \
|
||||
apk del .fetch-deps
|
||||
|
||||
# Copy configuration
|
||||
COPY etc /etc/
|
||||
COPY php.ini /usr/local/etc/php/conf.d/php-phpmyadmin.ini
|
||||
|
||||
# Copy main script
|
||||
COPY run.sh /run.sh
|
||||
|
||||
# We expose phpMyAdmin on port 80
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT [ "/run.sh" ]
|
||||
CMD ["phpmyadmin"]
|
||||
CMD ["supervisord", "-n"]
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
image: mariadb:latest
|
||||
db_server:
|
||||
image: ${DB}
|
||||
container_name: phpmyadmin_testing_mariadb
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=test123
|
||||
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
container_name: phpmyadmin_testing_mysql
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=test123
|
||||
volumes:
|
||||
- ./testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro
|
||||
|
||||
phpmyadmin:
|
||||
build:
|
||||
@@ -25,5 +21,4 @@ services:
|
||||
- PMA_ARBITRARY=1
|
||||
- TESTSUITE_PASSWORD=test123
|
||||
depends_on:
|
||||
- mariadb
|
||||
- mysql
|
||||
- db_server
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
user nobody;
|
||||
user nobody nogroup;
|
||||
worker_processes 4;
|
||||
|
||||
daemon off;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ log_level = warning
|
||||
|
||||
[www]
|
||||
user = nobody
|
||||
group = nobody
|
||||
group = nogroup
|
||||
listen = /var/run/php/php-fpm.sock
|
||||
listen.mode = 0660
|
||||
chdir = /www
|
||||
|
||||
-1918
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,13 @@ $vars = array(
|
||||
'PMA_PORTS',
|
||||
'PMA_USER',
|
||||
'PMA_PASSWORD',
|
||||
'PMA_ABSOLUTE_URI'
|
||||
'PMA_ABSOLUTE_URI',
|
||||
'PMA_CONTROLHOST',
|
||||
'PMA_CONTROLPORT',
|
||||
'PMA_PMADB',
|
||||
'PMA_CONTROLUSER',
|
||||
'PMA_CONTROLPASS',
|
||||
'PMA_QUERYHISTORYDB'
|
||||
);
|
||||
foreach ($vars as $var) {
|
||||
$env = getenv($var);
|
||||
@@ -21,6 +27,9 @@ foreach ($vars as $var) {
|
||||
$_ENV[$var] = $env;
|
||||
}
|
||||
}
|
||||
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
|
||||
$cfg['QueryHistoryDB'] = boolval($_ENV['PMA_QUERYHISTORYDB']);
|
||||
}
|
||||
|
||||
/* Arbitrary server connection */
|
||||
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
|
||||
@@ -64,6 +73,40 @@ for ($i = 1; isset($hosts[$i - 1]); $i++) {
|
||||
} else {
|
||||
$cfg['Servers'][$i]['auth_type'] = 'cookie';
|
||||
}
|
||||
if (isset($_ENV['PMA_PMADB'])) {
|
||||
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
|
||||
$cfg['Servers'][$i]['relation'] = 'pma__relation';
|
||||
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
|
||||
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
|
||||
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
|
||||
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
|
||||
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
|
||||
$cfg['Servers'][$i]['history'] = 'pma__history';
|
||||
$cfg['Servers'][$i]['recent'] = 'pma__recent';
|
||||
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
|
||||
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
|
||||
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
|
||||
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
|
||||
$cfg['Servers'][$i]['users'] = 'pma__users';
|
||||
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
|
||||
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
|
||||
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
|
||||
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
|
||||
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
|
||||
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
|
||||
}
|
||||
if (isset($_ENV['PMA_CONTROLHOST'])) {
|
||||
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
|
||||
}
|
||||
if (isset($_ENV['PMA_CONTROLPORT'])) {
|
||||
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
|
||||
}
|
||||
if (isset($_ENV['PMA_CONTROLUSER'])) {
|
||||
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
|
||||
}
|
||||
if (isset($_ENV['PMA_CONTROLPASS'])) {
|
||||
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
|
||||
}
|
||||
$cfg['Servers'][$i]['compress'] = false;
|
||||
$cfg['Servers'][$i]['AllowNoPassword'] = true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[program:php-fpm]
|
||||
command=php-fpm --nodaemonize --fpm-config /etc/php-fpm.conf -c /etc/php.ini
|
||||
command=php-fpm --nodaemonize --fpm-config /etc/php-fpm.conf
|
||||
user=nobody
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
[PHP]
|
||||
allow_url_fopen = Off
|
||||
max_execution_time = 600
|
||||
memory_limit = 512M
|
||||
open_basedir = /www/:/tmp/:/etc/phpmyadmin/
|
||||
post_max_size = 512M
|
||||
upload_max_filesize = 512M
|
||||
|
||||
[Session]
|
||||
session.cookie_httponly = 1
|
||||
session.hash_function = 1
|
||||
session.save_path = "/sessions"
|
||||
session.use_strict_mode = 1
|
||||
|
||||
[opcache]
|
||||
opcache.fast_shutdown = 1
|
||||
opcache.restrict_api = /disabled/
|
||||
opcache.save_comments = 0
|
||||
opcache.use_cwd = 0
|
||||
opcache.validate_timestamps = 0
|
||||
Binary file not shown.
@@ -1,22 +1,20 @@
|
||||
#!/bin/sh
|
||||
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ] ; then
|
||||
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
|
||||
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
|
||||
<?php
|
||||
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
|
||||
EOT
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/phpmyadmin/config.user.inc.php ] ; then
|
||||
touch /etc/phpmyadmin/config.user.inc.php
|
||||
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
|
||||
touch /etc/phpmyadmin/config.user.inc.php
|
||||
fi
|
||||
|
||||
mkdir -p /var/nginx/client_body_temp
|
||||
chown nobody:nobody /sessions /var/nginx/client_body_temp
|
||||
chown nobody:nogroup /sessions /var/nginx/client_body_temp
|
||||
mkdir -p /var/run/php/
|
||||
chown nobody:nobody /var/run/php/
|
||||
chown nobody:nogroup /var/run/php/
|
||||
touch /var/log/php-fpm.log
|
||||
chown nobody:nobody /var/log/php-fpm.log
|
||||
chown nobody:nogroup /var/log/php-fpm.log
|
||||
|
||||
if [ "$1" = 'phpmyadmin' ]; then
|
||||
exec supervisord --nodaemon --configuration="/etc/supervisord.conf" --loglevel=info
|
||||
fi
|
||||
exec "$@"
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@ FROM phpmyadmin/phpmyadmin
|
||||
RUN apk add --no-cache curl py2-pip
|
||||
RUN pip install mechanize html5lib
|
||||
|
||||
COPY test-mariadb.ini test-mysql.ini /etc/supervisor.d/
|
||||
COPY test.ini /etc/supervisor.d/
|
||||
COPY phpmyadmin_test.py test-docker.sh world.sql /
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[program:test-mysql]
|
||||
command=/test-docker.sh test 80 mysql
|
||||
command=/test-docker.sh test 80 db_server
|
||||
autostart=true
|
||||
autorestart=false
|
||||
priority=3
|
||||
@@ -0,0 +1,2 @@
|
||||
[mysqld]
|
||||
default_authentication_plugin = mysql_native_password
|
||||
@@ -11,7 +11,7 @@ TIMEOUT=0
|
||||
|
||||
sleep 5
|
||||
|
||||
while [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c 'Result of \(mysql\|mariadb\) tests'` -lt 2 ] ; do
|
||||
while [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c 'Result of db_server tests'` -lt 1 ] ; do
|
||||
sleep 1
|
||||
TIMEOUT=$(($TIMEOUT + 1))
|
||||
if [ $TIMEOUT -gt 20 ] ; then
|
||||
@@ -21,7 +21,7 @@ while [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c
|
||||
fi
|
||||
done
|
||||
|
||||
if [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c 'Result of \(mysql\|mariadb\) tests.*SUCCESS'` -lt 2 ] ; then
|
||||
if [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c 'Result of db_server tests.*SUCCESS'` -lt 1 ] ; then
|
||||
docker-compose -f docker-compose.testing.yml logs phpmyadmin
|
||||
echo "${RED}Failed${NC}"
|
||||
exit 2
|
||||
|
||||
Reference in New Issue
Block a user