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
|
|
|
|
|
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}
|
|
|
|
|
2024-11-24 23:47:07 +01:00
|
|
|
ARG APACHE_DOC_ROOT
|
|
|
|
ARG REDPANDA_CONSOLE_PORT
|
|
|
|
|
|
|
|
|
2024-09-04 16:30:27 +02:00
|
|
|
ARG PHPPGADMIN_OWNER="mentax"
|
|
|
|
ARG PHPPGADMIN_COMMIT="d0d35701af8644788f84b808d21e7fd04213baa0"
|
|
|
|
|
2024-11-24 23:47:07 +01:00
|
|
|
ARG PHPPGADMIN_HOME="${APACHE_DOC_ROOT}/phppgadmin"
|
|
|
|
ARG PHPPGADMIN_CONFIG="${PHPPGADMIN_HOME}/conf/config.inc.php"
|
|
|
|
|
|
|
|
ARG REDPANDA_CONSOLE_HOME="/opt/appl/redpanda_console"
|
|
|
|
ARG REDPANDA_CONSOLE_CONFIG="${REDPANDA_CONSOLE_HOME}/etc/redpanda-console-config.yaml"
|
2024-09-04 16:30:27 +02:00
|
|
|
|
|
|
|
|
2024-11-24 23:47:07 +01:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
2024-09-04 16:30:27 +02:00
|
|
|
ARG TOOLSD='#!/bin/bash \n\
|
|
|
|
\n\
|
2024-12-16 17:37:32 +01:00
|
|
|
sed -i "s/\t\$conf\[`servers`\]/\t\/\/\ $conf\[`servers`\]/" '${PHPPGADMIN_CONFIG}' \n\
|
2024-12-14 00:04:38 +01:00
|
|
|
sed -i "s/\$conf\[`extra_login_security`\] = true;/\$conf\[`extra_login_security`\] = false;/" '${PHPPGADMIN_CONFIG}' \n\
|
|
|
|
sed -i "s/?>//" '${PHPPGADMIN_CONFIG}' \n\
|
|
|
|
\n\
|
|
|
|
\n\
|
|
|
|
for vars in POSTGRESQL_SERVER_NAME:desc POSTGRESQL_HOST:host POSTGRESQL_PORT:port \n\
|
|
|
|
do \n\
|
|
|
|
IFS=":" \n\
|
|
|
|
set ${vars} \n\
|
|
|
|
\n\
|
|
|
|
eval read -r -a $2 \<\<\< "\${$1}" \n\
|
|
|
|
done \n\
|
|
|
|
\n\
|
|
|
|
IFS=" " \n\
|
|
|
|
\n\
|
|
|
|
i=0 \n\
|
|
|
|
while [[ ${i} -lt ${#host[@]} ]] \n\
|
|
|
|
do \n\
|
|
|
|
for var in desc host port \n\
|
|
|
|
do \n\
|
2024-12-16 17:37:32 +01:00
|
|
|
eval echo -e "`\t\$conf`[\`servers\`][${i}][\`${var}\`]` = `\`\${${var}[${i}]}\`\;" >> '${PHPPGADMIN_CONFIG}' \n\
|
2024-12-14 00:04:38 +01:00
|
|
|
done \n\
|
2024-12-16 17:37:32 +01:00
|
|
|
\n\
|
|
|
|
echo -e "\t\$conf[`servers`][${i}][`sslmode`] = `allow`;" >> '${PHPPGADMIN_CONFIG}' \n\
|
|
|
|
echo -e "\t\$conf[`servers`][${i}][`defaultdb`] = `postgres`;" >> '${PHPPGADMIN_CONFIG}' \n\
|
|
|
|
echo -e "\t\$conf[`servers`][${i}][`pg_dump_path`] = `/usr/bin/pg_dump`;" >> '${PHPPGADMIN_CONFIG}' \n\
|
|
|
|
echo -e "\t\$conf[`servers`][${i}][`pg_dumpall_path`] = `/usr/bin/pg_dumpall`;" >> '${PHPPGADMIN_CONFIG}' \n\
|
|
|
|
\n\
|
2024-12-14 00:04:38 +01:00
|
|
|
i=$(( ${i} + 1)) \n\
|
|
|
|
done \n\
|
|
|
|
\n\
|
|
|
|
echo "?>" >> '${PHPPGADMIN_CONFIG}''
|
2024-11-24 23:47:07 +01:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
2024-12-16 17:37:32 +01:00
|
|
|
#sed -i "s/\$conf\[`servers`\]\[0\]\[`desc`\]/\/\/\$conf\[`servers`\]\[0\]\[`desc`\]/" '${PHPPGADMIN_CONFIG}' \n\
|
|
|
|
#sed -i "s/\$conf\[`servers`\]\[0\]\[`host`\]/\/\/\$conf\[`servers`\]\[0\]\[`host`\]/" '${PHPPGADMIN_CONFIG}' \n\
|
|
|
|
#sed -i "s/\$conf\[`servers`\]\[0\]\[`port`\]/\/\/\$conf\[`servers`\]\[0\]\[`port`\]/" '${PHPPGADMIN_CONFIG}' \n\
|
2024-11-24 23:47:07 +01:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
ARG REDPANDA_CONSOLED='#!/bin/bash \n\
|
|
|
|
\n\
|
|
|
|
sed -i "s/^ - broker-/ #- broker-/" '${REDPANDA_CONSOLE_CONFIG}' \n\
|
|
|
|
\n\
|
|
|
|
for broker in ${KAFKA_BROKERS} \n\
|
|
|
|
do \n\
|
|
|
|
sed -i "s/^ brokers:/ brokers:\\n - ${broker}/" '${REDPANDA_CONSOLE_CONFIG}' \n\
|
|
|
|
done \n\
|
|
|
|
\n\
|
2024-11-25 01:05:33 +01:00
|
|
|
sed -i "s/^ #setBasePathFromXForwardedPrefix:/ setBasePathFromXForwardedPrefix:/" '${REDPANDA_CONSOLE_CONFIG}' \n\
|
2024-11-24 23:47:07 +01:00
|
|
|
sed -i "s/^#server:/server:/" '${REDPANDA_CONSOLE_CONFIG}' \n\
|
|
|
|
sed -i "s/^ #listenPort: 8080/ listenPort: '${REDPANDA_CONSOLE_PORT}'/" '${REDPANDA_CONSOLE_CONFIG}''
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
ARG REDPANDA_CONSOLED_INI='[program:redpanda_consoled] \n\
|
|
|
|
directory='${REDPANDA_CONSOLE_HOME}' \n\
|
|
|
|
command='${REDPANDA_CONSOLE_HOME}'/bin/redpanda-console -config.filepath '${REDPANDA_CONSOLE_CONFIG}''
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-16 17:37:32 +01:00
|
|
|
RUN urpmi --force wget postgresql15 \
|
2024-11-24 23:47:07 +01:00
|
|
|
&& 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 \
|
2024-12-16 17:37:32 +01:00
|
|
|
&& echo -e "${TOOLSD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/toolsd \
|
2024-11-24 23:47:07 +01:00
|
|
|
&& chmod a+x /etc/init.d/toolsd \
|
|
|
|
&& ln -s /etc/init.d/toolsd /etc/rcD.d/S40toolsd \
|
|
|
|
&& mkdir -p ${REDPANDA_CONSOLE_HOME}/bin ${REDPANDA_CONSOLE_HOME}/etc \
|
|
|
|
&& wget -q -O- "https://github.com/redpanda-data/console/releases/download/v2.7.2/redpanda_console_2.7.2_linux_amd64.tar.gz" | tar xzf - -C ${REDPANDA_CONSOLE_HOME}/bin \
|
|
|
|
&& wget -q -O- "https://docs.redpanda.com/current/shared/_attachments/redpanda-console-config.yaml" > ${REDPANDA_CONSOLE_CONFIG} \
|
|
|
|
&& echo -e "${REDPANDA_CONSOLED}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/redpanda_consoled \
|
|
|
|
&& chmod a+x /etc/init.d/redpanda_consoled \
|
|
|
|
&& ln -s /etc/init.d/redpanda_consoled /etc/rcD.d/S45redpanda_consoled \
|
|
|
|
&& echo -e "${REDPANDA_CONSOLED_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/redpanda_consoled.ini
|