2024-11-11 19:25:48 +01:00
|
|
|
# Rx3-Docker/Tools Docker Image
|
2024-09-04 16:30:27 +02:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2024-11-11 19:25:48 +01:00
|
|
|
ARG IMG_FROM_URL="rx3-docker/php-apache:latest"
|
2024-09-04 16:30:27 +02:00
|
|
|
|
2024-11-11 19:25:48 +01:00
|
|
|
FROM ${IMG_FROM_URL}
|
2024-09-04 16:30:27 +02:00
|
|
|
|
|
|
|
ARG IMG_NAME
|
2024-11-11 19:25:48 +01:00
|
|
|
ARG IMG_NAME_FULL
|
2024-09-04 16:30:27 +02:00
|
|
|
ARG IMG_VERSION
|
|
|
|
ARG IMG_MAINTAINER
|
|
|
|
|
|
|
|
ARG APACHE_DOC_ROOT
|
|
|
|
|
2024-11-11 19:25:48 +01:00
|
|
|
LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL}
|
2024-09-04 16:30:27 +02:00
|
|
|
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
|
|
|
|
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
|
|
|
|
LABEL maintainer=${IMG_MAINTAINER}
|
|
|
|
|
|
|
|
ARG PHPPGADMIN_OWNER="mentax"
|
|
|
|
ARG PHPPGADMIN_COMMIT="d0d35701af8644788f84b808d21e7fd04213baa0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
|
|
|
ARG TOOLSD='#!/bin/bash \n\
|
|
|
|
\n\
|
|
|
|
sed -i "s/$conf\[`servers`\]\[0\]\[`desc`\] = `PostgreSQL`;/$conf\[`servers`\]\[0\]\[`desc`\] = `${POSTGRESQL_SERVER_NAME}`;/" '${APACHE_DOC_ROOT}'/phppgadmin/conf/config.inc.php \n\
|
|
|
|
sed -i "s/$conf\[`servers`\]\[0\]\[`host`\] = ``;/$conf\[`servers`\]\[0\]\[`host`\] = `${POSTGRESQL_HOST}`;/" '${APACHE_DOC_ROOT}'/phppgadmin/conf/config.inc.php \n\
|
|
|
|
sed -i "s/$conf\[`servers`\]\[0\]\[`port`\] = 5432;/$conf\[`servers`\]\[0\]\[`port`\] = ${POSTGRESQL_PORT};/" '${APACHE_DOC_ROOT}'/phppgadmin/conf/config.inc.php \n\
|
|
|
|
sed -i "s/$conf\[`extra_login_security`\] = true;/$conf\[`extra_login_security`\] = false;/" '${APACHE_DOC_ROOT}'/phppgadmin/conf/config.inc.php'
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-11 19:25:48 +01:00
|
|
|
RUN urpmi --force wget \
|
|
|
|
&& mkdir -p /var/www/appl \
|
|
|
|
&& wget -q -O- "https://github.com/${PHPPGADMIN_OWNER}/phppgadmin/archive/${PHPPGADMIN_COMMIT}.tar.gz" | tar xzf - -C ${APACHE_DOC_ROOT} \
|
|
|
|
&& mv ${APACHE_DOC_ROOT}/phppgadmin-${PHPPGADMIN_COMMIT} ${APACHE_DOC_ROOT}/phppgadmin \
|
|
|
|
&& sed -i 's/$_SERVER\['\''REQUEST_URI'\''\]/preg_replace(\"\/^\\\/phppgadmin\\\/\/", "", $_SERVER['\''REQUEST_URI'\''])/g' ${APACHE_DOC_ROOT}/phppgadmin/display.php \
|
|
|
|
&& cp ${APACHE_DOC_ROOT}/phppgadmin/conf/config.inc.php-dist ${APACHE_DOC_ROOT}/phppgadmin/conf/config.inc.php \
|
|
|
|
&& echo -e "${TOOLSD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/toolsd \
|
|
|
|
&& chmod a+x /etc/init.d/toolsd \
|
2024-09-04 16:30:27 +02:00
|
|
|
&& ln -s /etc/init.d/toolsd /etc/rcD.d/S40toolsd
|