mirror of
https://github.com/phpmyadmin/docker.git
synced 2026-08-26 10:12:17 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c099349ef3 | ||
|
|
a602d1d4c6 | ||
|
|
8a8e9eee0a | ||
|
|
a5dfdfe993 | ||
|
|
f67529f585 | ||
|
|
e6bc219529 | ||
|
|
ef53180e08 | ||
|
|
4cadf08f00 | ||
|
|
e713caa214 | ||
|
|
cce91f08d4 | ||
|
|
9d0dec3d2e | ||
|
|
563bcafcec | ||
|
|
0bc8b4025b | ||
|
|
812590e038 | ||
|
|
7d6f729bc6 | ||
|
|
593d7f5f96 |
+16
-6
@@ -1,11 +1,21 @@
|
||||
# Switch back to stable once 3.4 is out
|
||||
FROM alpine:edge
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk add --no-cache php5-cli php5-mysqli php5-ctype php5-xml php5-gd php5-zlib php5-openssl php5-curl php5-opcache php5-json php5-mcrypt curl
|
||||
RUN apk add --no-cache php5-cli php5-mysqli php5-ctype php5-xml php5-gd php5-zlib php5-bz2 php5-zip php5-openssl php5-curl php5-opcache php5-json
|
||||
|
||||
RUN curl --location https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz | tar xzf - \
|
||||
&& mv phpMyAdmin* /www \
|
||||
&& rm -rf /www/js/jquery/src/ /www/examples /www/po/
|
||||
COPY phpmyadmin.keyring /
|
||||
|
||||
RUN set -x \
|
||||
&& export GNUPGHOME="$(mktemp -d)" \
|
||||
&& apk add --no-cache curl gnupg \
|
||||
&& curl --output phpMyAdmin-latest-all-languages.tar.gz --location https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz \
|
||||
&& curl --output phpMyAdmin-latest-all-languages.tar.gz.asc --location https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz.asc \
|
||||
&& gpgv --keyring /phpmyadmin.keyring phpMyAdmin-latest-all-languages.tar.gz.asc phpMyAdmin-latest-all-languages.tar.gz \
|
||||
&& apk del curl gnupg \
|
||||
&& rm -rf "$GNUPGHOME" \
|
||||
&& tar xzf phpMyAdmin-latest-all-languages.tar.gz \
|
||||
&& rm -f phpMyAdmin-latest-all-languages.tar.gz phpMyAdmin-latest-all-languages.tar.gz.asc \
|
||||
&& mv phpMyAdmin* /www \
|
||||
&& rm -rf /www/js/jquery/src/ /www/examples /www/po/
|
||||
|
||||
COPY config.inc.php /www/
|
||||
COPY run.sh /run.sh
|
||||
|
||||
@@ -48,8 +48,23 @@ Using the docker-compose.yml from https://github.com/phpmyadmin/docker
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Usage behind reverse proxys
|
||||
Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma.example.net/``) where the reverse proxy makes phpMyAdmin available.
|
||||
## Adding Custom Configuration
|
||||
|
||||
You can add your own custom config.inc.php settings (such as Configuration Storage setup)
|
||||
by creating a file named "config.user.inc.php" with the various user defined settings
|
||||
in it, and then linking it into the container using:
|
||||
|
||||
```
|
||||
-v /some/local/directory/config.user.inc.php:/config.user.inc.php
|
||||
```
|
||||
On the "docker run" line like this:
|
||||
```
|
||||
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/config.user.inc.php phpmyadmin/phpmyadmin
|
||||
```
|
||||
|
||||
See the following links for config file information.
|
||||
http://docs.phpmyadmin.net/en/latest/config.html#config
|
||||
http://docs.phpmyadmin.net/en/latest/setup.html
|
||||
|
||||
## Environment variables summary
|
||||
|
||||
@@ -58,10 +73,9 @@ Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma
|
||||
* ``PMA_PORT`` - define port of the MySQL server
|
||||
* ``PMA_HOSTS`` - define comma separated list of address/host names of the MySQL servers
|
||||
* ``PMA_USER`` and ``PMA_PASSWORD`` - define username to use for config authentication method
|
||||
* ``PMA_ABSOLUTE_URI`` - define user-facing URI
|
||||
* ``PHP_UPLOAD_MAX_FILESIZE`` - define upload_max_filesize and post_max_size PHP settings
|
||||
* ``PHP_MAX_INPUT_VARS`` - define max_input_vars PHP setting
|
||||
|
||||
For more detailed documentation see http://docs.phpmyadmin.net/en/latest/setup.html#installing-using-docker
|
||||
For more detailed documentation see https://docs.phpmyadmin.net/en/latest/setup.html#installing-using-docker
|
||||
|
||||
[hub]: https://hub.docker.com/r/phpmyadmin/phpmyadmin/
|
||||
|
||||
+7
-7
@@ -10,7 +10,6 @@ $vars = array(
|
||||
'PMA_PORT',
|
||||
'PMA_USER',
|
||||
'PMA_PASSWORD',
|
||||
'PMA_ABSOLUTE_URI'
|
||||
);
|
||||
foreach ($vars as $var) {
|
||||
if (!isset($_ENV[$var]) && getenv($var)) {
|
||||
@@ -23,11 +22,6 @@ if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
|
||||
$cfg['AllowArbitraryServer'] = true;
|
||||
}
|
||||
|
||||
/* Play nice behind reverse proxys */
|
||||
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
|
||||
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
|
||||
}
|
||||
|
||||
/* Figure out hosts */
|
||||
|
||||
/* Fallback to default linked */
|
||||
@@ -46,7 +40,7 @@ for ($i = 1; isset($hosts[$i - 1]); $i++) {
|
||||
if (isset($_ENV['PMA_PORT'])) {
|
||||
$cfg['Servers'][$i]['port'] = $_ENV['PMA_PORT'];
|
||||
}
|
||||
if (isset($_ENV['PMA_USER'])) {
|
||||
if (isset($_ENV['PMA_USER'])) {
|
||||
$cfg['Servers'][$i]['auth_type'] = 'config';
|
||||
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
|
||||
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : null;
|
||||
@@ -61,3 +55,9 @@ for ($i = 1; isset($hosts[$i - 1]); $i++) {
|
||||
/* Uploads setup */
|
||||
$cfg['UploadDir'] = '';
|
||||
$cfg['SaveDir'] = '';
|
||||
|
||||
/* Include User Defined Settings Hook */
|
||||
if (file_exists('/config.user.inc.php')) {
|
||||
include('/config.user.inc.php');
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -4,12 +4,16 @@ set -x
|
||||
if [ ! -f /www/config.secret.inc.php ] ; then
|
||||
cat > /www/config.secret.inc.php <<EOT
|
||||
<?php
|
||||
\$cfg['blowfish_secret'] = '`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`';
|
||||
\$cfg['blowfish_secret'] = '`cat /dev/urandom | tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' | fold -w 32 | head -n 1`';
|
||||
EOT
|
||||
fi
|
||||
|
||||
if [ ! -f /config.user.inc.php ] ; then
|
||||
touch /config.user.inc.php
|
||||
fi
|
||||
|
||||
exec php -S 0.0.0.0:80 -t /www/ \
|
||||
-d upload_max_filesize=$PHP_UPLOAD_MAX_FILESIZE \
|
||||
-d post_max_size=$PHP_UPLOAD_MAX_FILESIZE \
|
||||
-d max_input_vars=$PHP_MAX_INPUT_VARS \
|
||||
-d session.save-path=/sessions
|
||||
-d session.save_path=/sessions
|
||||
|
||||
Reference in New Issue
Block a user