Migrate to a docker-compose config with a few persistence.
./data/nginx/ for nginx host configurations. ./data/mysql/ for mysql databases.
This commit is contained in:
15
Dockerfile
15
Dockerfile
@ -6,19 +6,6 @@ RUN apt-get update && \
|
||||
apt-get install -y systemd systemd-sysv cron anacron nano wget curl git mariadb-server mariadb-client nginx php-fpm php-common php-gd php-mysql php-imap php-cli php-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear mcrypt imagemagick libruby libapache2-mod-python php-curl php-intl php-pspell php-sqlite3 php-tidy php-xmlrpc php-xsl memcached php-memcache php-imagick php-zip php-mbstring memcached libapache2-mod-passenger php-soap php-opcache php-apcu libapache2-reload-perl php-mcrypt && \
|
||||
apt-get clean
|
||||
|
||||
# Instalamos phpmyadmin y definimos la contraseña de root de mariadb en blanco para @localhost.
|
||||
RUN service mariadb start && \
|
||||
export DEBIAN_FRONTEND=noninteractive && \
|
||||
apt-get -yq install phpmyadmin && \
|
||||
mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD(''); FLUSH PRIVILEGES;" && \
|
||||
service mariadb stop
|
||||
|
||||
# Permitimos el que se pueda loguear sin contraseña para usar el usuario root de ese modo
|
||||
RUN sed -i "s/ \/\/ \$cfg\['Servers'\]\[\$i\]\['AllowNoPassword'\]/ \$cfg\['Servers'\]\[\$i\]\['AllowNoPassword'\]/" /etc/phpmyadmin/config.inc.php
|
||||
|
||||
# Añadimos las reglas nginx para poder ver phpmyadmin en http://localhost/phpmyadmin
|
||||
RUN sed -i "s/server_name _;/server_name _;\n\nlocation \/phpmyadmin {\n root \/usr\/share\/;\n index index.php index.html index.htm;\n location ~ \^\/phpmyadmin\/\(.+\.php\)\$ {\n try_files \$uri =404;\n root \/usr\/share\/;\n fastcgi_pass unix:\/var\/run\/php\/php8.2-fpm.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME \$request_filename;\n include \/etc\/nginx\/fastcgi_params;\n fastcgi_param PATH_INFO \$fastcgi_script_name;\n fastcgi_buffer_size 128k;\n fastcgi_buffers 256 4k;\n fastcgi_busy_buffers_size 256k;\n fastcgi_temp_file_write_size 256k;\n fastcgi_intercept_errors on;\n }\n location ~* \^\/phpmyadmin\/\(.+\\.\(jpg\|jpeg\|gif\|css\|png\|js\|ico\|html\|xml\|txt\)\)\$ {\n root \/usr\/share\/;\n }\n}\nlocation \/phpMyAdmin {\n rewrite \^\/* \/phpmyadmin last;\n}/g" /etc/nginx/sites-available/default
|
||||
|
||||
# Mostrar los errores en PHP
|
||||
RUN sed -i 's/display_errors = Off/display_errors = On/' /etc/php/8.2/fpm/php.ini && \
|
||||
sed -i 's/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/error_reporting = E_ALL/' /etc/php/8.2/fpm/php.ini
|
||||
@ -48,6 +35,8 @@ COPY bin/adddomain /usr/local/bin/adddomain
|
||||
RUN chmod +x /usr/local/bin/adddomain
|
||||
COPY bin/addsubdomain /usr/local/bin/addsubdomain
|
||||
RUN chmod +x /usr/local/bin/addsubdomain
|
||||
COPY bin/mysql_configure /usr/local/bin/mysql_configure
|
||||
RUN chmod +x /usr/local/bin/mysql_configure
|
||||
|
||||
# Colocamos dentro el certificado SSL
|
||||
COPY ssl /etc/nginx/ssl
|
||||
|
Reference in New Issue
Block a user