passage docker paheko upstream

This commit is contained in:
Fanch 2024-07-11 20:34:21 +02:00
parent 7e79fe2a7b
commit 61fb275803
5 changed files with 14 additions and 119 deletions

View File

@ -1,67 +1,7 @@
FROM php:8.2-apache FROM paheko/paheko:1.3.10
# pour upgrader paheko, il suffit de modifier le numéro de version ici #ENV PAHEKO_DIR /usr/share/paheko
ENV PAHEKO_VERSION 1.3.9 ENV PAHEKO_DIR /var/www/paheko
ENV PAHEKO_DOWNLOAD_DIR download/paheko
ENV PAHEKO_DIR /usr/share/paheko
########################################
# APT local cache
# work around because COPY failed if no source file
#COPY .dummy .apt-mirror-confi[g] .proxy-confi[g] /
#RUN cp /.proxy-config /etc/profile.d/proxy.sh 2> /dev/null || true
#RUN if [ -f /.apt-mirror-config ] ; then . /.apt-mirror-config && sed -i \
# -e "s/deb.debian.org/${APT_MIRROR_DEBIAN}/g" \
# -e "s/security.debian.org/${APT_MIRROR_DEBIAN_SECURITY}/g" \
# -e "s/archive.ubuntu.com/${APT_MIRROR_UBUNTU}/g" \
# -e "s/security.ubuntu.com/${APT_MIRROR_UBUNTU_SECURITY}/g" \
# /etc/apt/sources.list; fi
########################################
RUN apt-get update --quiet && apt-get install -y \
libicu-dev libpq-dev zlib1g-dev libicu-dev \
libzip-dev git wget zip patch imagemagick libmagickwand-dev; \
pecl install imagick; \
docker-php-ext-install zip; \
docker-php-ext-enable imagick;
#install composer setup script
COPY dockers/paheko/composer-setup.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/composer-setup.sh
#install internationalization libs
RUN docker-php-ext-configure intl
RUN docker-php-ext-install intl
RUN docker-php-ext-install -j$(nproc) pdo ctype
RUN /usr/local/bin/composer-setup.sh
ADD "${PAHEKO_DOWNLOAD_DIR}/paheko-${PAHEKO_VERSION}.tar.gz" /usr/share/
RUN mv /usr/share/paheko-${PAHEKO_VERSION} ${PAHEKO_DIR}
RUN echo '<IfModule mod_negotiation.c>\n\
Options -MultiViews\n\
</IfModule>\n\
\n\
php_value upload_max_filesize 100M\n\
php_value post_max_size 100M\n\
php_value memory_limit 256M\n\
FallbackResource /_route.php\n\
'> ${PAHEKO_DIR}/www/.htaccess
#install prince pour génération pdf
RUN curl https://www.princexml.com/download/prince_20230609-1_debian12_amd64.deb --output prince.deb
RUN apt-get install libdeflate0 libjbig0 libjpeg62-turbo -y
#on récupère 2 paquets de sécu sur bullseyes (me demande pas pourquoi)
RUN curl http://security.debian.org/debian-security/pool/updates/main/libw/libwebp/libwebp6_0.6.1-2.1+deb11u2_amd64.deb --output libwebp6_0.6.1.deb
RUN curl http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb11u5_amd64.deb --output libssl1.1_1.1.deb
RUN dpkg -i libwebp6_0.6.1.deb
RUN dpkg -i libssl1.1_1.1.deb
RUN apt-get install libfontconfig1 libgif7 libjpeg62-turbo liblcms2-2 libtiff5-dev -y
RUN apt-get install libaom3 libavif15 -y
RUN dpkg -i prince.deb
COPY dockers/paheko/config/factory_cron.sh ${PAHEKO_DIR}/ COPY dockers/paheko/config/factory_cron.sh ${PAHEKO_DIR}/
COPY dockers/paheko/config/factory_cron_emails.sh ${PAHEKO_DIR}/ COPY dockers/paheko/config/factory_cron_emails.sh ${PAHEKO_DIR}/
@ -72,9 +12,6 @@ RUN mkdir ${PAHEKO_DIR}/users
COPY "dockers/paheko/config/facturation.tar.gz" ${PAHEKO_DIR}/data/plugins/ COPY "dockers/paheko/config/facturation.tar.gz" ${PAHEKO_DIR}/data/plugins/
RUN mkdir ${PAHEKO_DIR}/data/plugins/facturation && tar zxvf ${PAHEKO_DIR}/data/plugins/facturation.tar.gz -C ${PAHEKO_DIR}/data/plugins/facturation && rm ${PAHEKO_DIR}/data/plugins/facturation.tar.gz RUN mkdir ${PAHEKO_DIR}/data/plugins/facturation && tar zxvf ${PAHEKO_DIR}/data/plugins/facturation.tar.gz -C ${PAHEKO_DIR}/data/plugins/facturation && rm ${PAHEKO_DIR}/data/plugins/facturation.tar.gz
#fab: pour eviter l'anomalie: $msg mustn't contain any NULL byte
#RUN sed -i "394i\$msg = str_replace(chr(0), '', \$msg);" ${PAHEKO_DIR}/include/lib/KD2/ErrorManager.php
#install cron pour factory_cron.sh #install cron pour factory_cron.sh
RUN apt-get install cron joe rsyslog -y RUN apt-get install cron joe rsyslog -y
RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
@ -84,11 +21,15 @@ RUN chmod 600 /var/spool/cron/crontabs/root
RUN sed -i "/exec/i\service cron start\n" /usr/local/bin/docker-php-entrypoint RUN sed -i "/exec/i\service cron start\n" /usr/local/bin/docker-php-entrypoint
RUN ln -sf /usr/local/bin/php /usr/bin/ RUN ln -sf /usr/local/bin/php /usr/bin/
#outil pour debugger dans le docker
RUN apt-get install -y inetutils-ping net-tools
# Set owner web server # Set owner web server
RUN chown -R www-data: ${PAHEKO_DIR} RUN chown -R www-data: ${PAHEKO_DIR}
#fab le 03/02/2023: pour avoir un php.ini de prod avec zend.assertions = -1 #fab le 03/02/2023: pour avoir un php.ini de prod avec zend.assertions = -1
RUN cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" RUN cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini"
HEALTHCHECK --timeout=10s CMD exit 0
EXPOSE 80 EXPOSE 80
VOLUME [ "/usr/share/paheko/users" ] VOLUME [ "${PAHEKO_DIR}/users" ]

View File

@ -4,33 +4,6 @@ KAZ_ROOT=$(cd "$(dirname $0)/../.."; pwd)
. "${KAZ_ROOT}/bin/.commonFunctions.sh" . "${KAZ_ROOT}/bin/.commonFunctions.sh"
setKazVars setKazVars
###########################################################################"
#on récupère la dernière version de paheko et tous les plugin
PAHEKO_VER=$(grep "^ENV PAHEKO_VERSION" Dockerfile | awk '{print $3}')
#FCT_VER="0.8.5"
echo "VERSION PAHEKO : $PAHEKO_VER"
#echo "VERSION FACTURATION : $FCT_VER"
downloadFile () {
# $1 URL to download
if [ ! -f "$(basename "$1")" ]; then
printKazMsg " - load $1"
curl -L -O "$1"
fi
}
mkdir -p "${KAZ_DNLD_DIR}/paheko"
cd "${KAZ_DNLD_DIR}/paheko"
#pour être certain de récupérer les dernières versions de plugin
rm * -f
printKazMsg "\n *** Download paheko on ${KAZ_DNLD_DIR}"
downloadFile "https://fossil.kd2.org/paheko/uv/paheko-${PAHEKO_VER}.tar.gz"
###########################################################################
printKazMsg "\n *** Création du Dockerfile paheko" printKazMsg "\n *** Création du Dockerfile paheko"
cd "${KAZ_ROOT}" cd "${KAZ_ROOT}"

View File

@ -1,18 +0,0 @@
#!/bin/sh
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT

View File

@ -98,7 +98,7 @@ define('Paheko\DATA_ROOT', $user_data_dir);
const PREFER_HTTPS = false; const PREFER_HTTPS = false;
const SMTP_HOST = "__SMTP_HOST__.__DOMAIN__"; const SMTP_HOST = "__SMTP_HOST__.__DOMAIN__";
const SMTP_USER = null; const SMTP_USER = null;
const API_USER = "__PAHEKO_API_USER__"; const API_USER = "__PAHEKO_API_USER__";
const API_PASSWORD = "__PAHEKO_API_PASSWORD__"; const API_PASSWORD = "__PAHEKO_API_PASSWORD__";
const SMTP_PASSWORD = null; const SMTP_PASSWORD = null;
const SMTP_PORT = 25; const SMTP_PORT = 25;
@ -126,4 +126,5 @@ define('Paheko\SHOW_ERRORS', true);
#add by fab le 21/04/2022 #add by fab le 21/04/2022
//const PDF_COMMAND = 'prince'; //const PDF_COMMAND = 'prince';
const PDF_COMMAND = 'auto'; # const PDF_COMMAND = 'auto';
const PDF_COMMAND = 'chromium --no-sandbox --headless --disable-dev-shm-usage --autoplay-policy=no-user-gesture-required --no-first-run --disable-gpu --disable-features=DefaultPassthroughCommandDecoder --use-fake-ui-for-media-stream --use-fake-device-for-media-stream --disable-sync --print-to-pdf=%2$s %1$s';

View File

@ -7,11 +7,9 @@ services:
build: . build: .
container_name: ${pahekoServName} container_name: ${pahekoServName}
volumes: volumes:
- ./config/paheko.conf:/etc/apache2/sites-available/000-default.conf - ./config/config.local.php:/var/www/paheko/config.local.php
- ./config/config.local.php:/usr/share/paheko/config.local.php - ./config/factory_cron.sh:/var/www/paheko/factory_cron.sh
- ./config/factory_cron.sh:/usr/share/paheko/factory_cron.sh - assoUsers:/var/www/paheko/users
# - ./config/cron.php:/usr/share/paheko/scripts/cron.php
- assoUsers:/usr/share/paheko/users
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro
# ports: # ports: