add nginx with phpMyAdmin
This commit is contained in:
+26
-6
@@ -1,24 +1,44 @@
|
|||||||
FROM mariadb:latest
|
FROM mariadb:latest
|
||||||
|
|
||||||
|
ARG phpmyadmin_version="5.2.0"
|
||||||
|
ARG ubuntu_codename="jammy"
|
||||||
|
|
||||||
ENV TZ=Europe/Vienna
|
ENV TZ=Europe/Vienna
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
COPY scripts/docker-entrypoint.sh /usr/local/bin/
|
||||||
COPY myteleport.cnf /etc/mysql/mariadb.conf.d/z-custom-for-teleport.cnf
|
COPY configs/myteleport.cnf /etc/mysql/mariadb.conf.d/z-custom-for-teleport.cnf
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl
|
RUN apt-get update && apt-get install -y curl
|
||||||
|
|
||||||
RUN curl https://apt.releases.teleport.dev/gpg \
|
RUN curl https://apt.releases.teleport.dev/gpg \
|
||||||
-o /usr/share/keyrings/teleport-archive-keyring.asc
|
-o /usr/share/keyrings/teleport-archive-keyring.asc
|
||||||
|
RUN export VERSION_CODENAME=$ubuntu_codename && echo "deb [signed-by=/usr/share/keyrings/teleport-archive-keyring.asc] \
|
||||||
RUN export VERSION_CODENAME=jammy && echo "deb [signed-by=/usr/share/keyrings/teleport-archive-keyring.asc] \
|
|
||||||
https://apt.releases.teleport.dev/ubuntu ${VERSION_CODENAME?} stable/v11" \
|
https://apt.releases.teleport.dev/ubuntu ${VERSION_CODENAME?} stable/v11" \
|
||||||
| tee /etc/apt/sources.list.d/teleport.list > /dev/null
|
| tee /etc/apt/sources.list.d/teleport.list > /dev/null
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y teleport
|
RUN apt-get update && apt-get install -y teleport nginx wget unzip
|
||||||
|
RUN apt-get install -y php-imagick php-phpseclib php-php-gettext php8.1-common php8.1-mysql php8.1-gd php8.1-imap php8.1-curl php8.1-zip php8.1-xml php8.1-mbstring php8.1-bz2 php8.1-intl php8.1-gmp php8.1-fpm
|
||||||
|
|
||||||
|
# Nginx Config
|
||||||
|
COPY configs/nginx.conf /etc/nginx/sites-available/default
|
||||||
|
|
||||||
|
# Install phpmyadmin
|
||||||
|
RUN wget https://files.phpmyadmin.net/phpMyAdmin/$phpmyadmin_version/phpMyAdmin-$phpmyadmin_version-all-languages.zip
|
||||||
|
RUN unzip phpMyAdmin-$phpmyadmin_version-all-languages.zip
|
||||||
|
|
||||||
|
RUN mkdir -p /var/www/phpmyadmin
|
||||||
|
RUN mv phpMyAdmin-$phpmyadmin_version-all-languages/* /var/www/phpmyadmin
|
||||||
|
RUN rm -rf phpMyAdmin-$phpmyadmin_version-all-languages.zip
|
||||||
|
|
||||||
|
COPY --chown=www-data:www-data configs/phpmyadmin.config.php /var/www/phpmyadmin/config.inc.php
|
||||||
|
RUN chown -R www-data:www-data /var/www/phpmyadmin
|
||||||
|
RUN chmod 777 /var/www/phpmyadmin
|
||||||
|
|
||||||
|
RUN rm -rf /phpMyAdmin-$phpmyadmin_version-all-languages
|
||||||
|
|
||||||
VOLUME /var/lib/mysql
|
VOLUME /var/lib/mysql
|
||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
|
|
||||||
EXPOSE 3306
|
EXPOSE 80 3306
|
||||||
CMD ["mariadbd"]
|
CMD ["mariadbd"]
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ run_docker_container() {
|
|||||||
echo "Running..."
|
echo "Running..."
|
||||||
docker run -d \
|
docker run -d \
|
||||||
-p 3306:3306 \
|
-p 3306:3306 \
|
||||||
|
-p 8080:80 \
|
||||||
-e TZ="Europe/Vienna" \
|
-e TZ="Europe/Vienna" \
|
||||||
-e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD="true" \
|
-e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD="true" \
|
||||||
|
-e RUN_WEBSERVER="yes" \
|
||||||
"$DOCKER_IMAGE_NAME":"$GIT_BRANCH"
|
"$DOCKER_IMAGE_NAME":"$GIT_BRANCH"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
root /var/www/phpmyadmin/;
|
||||||
|
index index.php index.html index.htm index.nginx-debian.html;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/phpmyadmin_access.log;
|
||||||
|
error_log /var/log/nginx/phpmyadmin_error.log;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(doc|sql|setup)/ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
include fastcgi_params;
|
||||||
|
include snippets/fastcgi-php.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* phpMyAdmin sample configuration, you can use it as base for
|
||||||
|
* manual configuration. For easier setup you can use setup/
|
||||||
|
*
|
||||||
|
* All directives are explained in documentation in the doc/ folder
|
||||||
|
* or at <https://docs.phpmyadmin.net/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Servers configuration
|
||||||
|
*/
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* First server
|
||||||
|
*/
|
||||||
|
$i++;
|
||||||
|
/* Authentication type */
|
||||||
|
$cfg['Servers'][$i]['auth_type'] = 'cookie';
|
||||||
|
/* Server parameters */
|
||||||
|
$cfg['Servers'][$i]['host'] = 'localhost';
|
||||||
|
$cfg['Servers'][$i]['compress'] = true;
|
||||||
|
$cfg['Servers'][$i]['AllowNoPassword'] = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* phpMyAdmin configuration storage settings.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* User used to manipulate with storage */
|
||||||
|
// $cfg['Servers'][$i]['controlhost'] = '';
|
||||||
|
// $cfg['Servers'][$i]['controlport'] = '';
|
||||||
|
// $cfg['Servers'][$i]['controluser'] = 'pma';
|
||||||
|
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
|
||||||
|
|
||||||
|
/* Storage database and tables */
|
||||||
|
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
|
||||||
|
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
|
||||||
|
// $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]['history'] = 'pma__history';
|
||||||
|
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
|
||||||
|
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
|
||||||
|
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
|
||||||
|
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
|
||||||
|
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
|
||||||
|
// $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';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* End of servers configuration
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Directories for saving/loading files from server
|
||||||
|
*/
|
||||||
|
$cfg['UploadDir'] = '';
|
||||||
|
$cfg['SaveDir'] = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to display icons or text or both icons and text in table row
|
||||||
|
* action segment. Value can be either of 'icons', 'text' or 'both'.
|
||||||
|
* default = 'both'
|
||||||
|
*/
|
||||||
|
//$cfg['RowActionType'] = 'icons';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines whether a user should be displayed a "show all (records)"
|
||||||
|
* button in browse mode or not.
|
||||||
|
* default = false
|
||||||
|
*/
|
||||||
|
//$cfg['ShowAll'] = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of rows displayed when browsing a result set. If the result
|
||||||
|
* set contains more rows, "Previous" and "Next".
|
||||||
|
* Possible values: 25, 50, 100, 250, 500
|
||||||
|
* default = 25
|
||||||
|
*/
|
||||||
|
//$cfg['MaxRows'] = 50;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disallow editing of binary fields
|
||||||
|
* valid values are:
|
||||||
|
* false allow editing
|
||||||
|
* 'blob' allow editing except for BLOB fields
|
||||||
|
* 'noblob' disallow editing except for BLOB fields
|
||||||
|
* 'all' disallow editing
|
||||||
|
* default = 'blob'
|
||||||
|
*/
|
||||||
|
//$cfg['ProtectBinary'] = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default language to use, if not browser-defined or user-defined
|
||||||
|
* (you find all languages in the locale folder)
|
||||||
|
* uncomment the desired line:
|
||||||
|
* default = 'en'
|
||||||
|
*/
|
||||||
|
//$cfg['DefaultLang'] = 'en';
|
||||||
|
//$cfg['DefaultLang'] = 'de';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How many columns should be used for table display of a database?
|
||||||
|
* (a value larger than 1 results in some information being hidden)
|
||||||
|
* default = 1
|
||||||
|
*/
|
||||||
|
//$cfg['PropertiesNumColumns'] = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to true if you want DB-based query history.If false, this utilizes
|
||||||
|
* JS-routines to display query history (lost by window close)
|
||||||
|
*
|
||||||
|
* This requires configuration storage enabled, see above.
|
||||||
|
* default = false
|
||||||
|
*/
|
||||||
|
//$cfg['QueryHistoryDB'] = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When using DB-based query history, how many entries should be kept?
|
||||||
|
* default = 25
|
||||||
|
*/
|
||||||
|
//$cfg['QueryHistoryMax'] = 100;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not to query the user before sending the error report to
|
||||||
|
* the phpMyAdmin team when a JavaScript error occurs
|
||||||
|
*
|
||||||
|
* Available options
|
||||||
|
* ('ask' | 'always' | 'never')
|
||||||
|
* default = 'ask'
|
||||||
|
*/
|
||||||
|
//$cfg['SendErrorReports'] = 'always';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 'URLQueryEncryption' defines whether phpMyAdmin will encrypt sensitive data from the URL query string.
|
||||||
|
* 'URLQueryEncryptionSecretKey' is a 32 bytes long secret key used to encrypt/decrypt the URL query string.
|
||||||
|
*/
|
||||||
|
//$cfg['URLQueryEncryption'] = true;
|
||||||
|
//$cfg['URLQueryEncryptionSecretKey'] = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You can find more configuration options in the documentation
|
||||||
|
* in the doc/ folder or at <https://docs.phpmyadmin.net/>.
|
||||||
|
*/
|
||||||
|
$cfg['ShowStats'] = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is needed for cookie based authentication to encrypt password in
|
||||||
|
* cookie. Needs to be 32 chars long.
|
||||||
|
*/
|
||||||
@@ -544,8 +544,22 @@ _check_to_run_teleport() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_run_web_server() {
|
||||||
|
if [ ! -z "$RUN_WEBSERVER" ]; then
|
||||||
|
if [ ! -f "/var/www/phpmyadmin/.installed" ]; then
|
||||||
|
export SECRET=`php -r 'echo base64_encode(random_bytes(24));'`
|
||||||
|
echo "\$cfg['blowfish_secret'] = '$SECRET';" >> /var/www/phpmyadmin/config.inc.php
|
||||||
|
chown www-data:www-data /var/www/phpmyadmin/config.inc.php
|
||||||
|
touch "/var/www/phpmyadmin/.installed"
|
||||||
|
fi
|
||||||
|
php-fpm8.1 &
|
||||||
|
nginx &
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# If we are sourced from elsewhere, don't perform any further actions
|
# If we are sourced from elsewhere, don't perform any further actions
|
||||||
if ! _is_sourced; then
|
if ! _is_sourced; then
|
||||||
_check_to_run_teleport
|
_check_to_run_teleport
|
||||||
|
_run_web_server
|
||||||
_main "$@"
|
_main "$@"
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user