Compare commits

..

No commits in common. "0690e55c43310297e06d5789df14312b218bb5ed" and "c036e6dddf72fe6677fed379a07ba0f6e0967bae" have entirely different histories.

5 changed files with 79 additions and 23 deletions

View File

@ -1,6 +1,44 @@
# Build time variables # Build time variables
ARG SRCIMAGE=debian:trixie-slim ARG SRCIMAGE=debian:bookworm-slim
FROM $SRCIMAGE AS builder
ARG LSMB_VERSION="1.12.5"
ARG LSMB_DL_DIR="Releases"
ARG ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSION/ledgersmb-$LSMB_VERSION.tar.gz"
RUN set -x ; \
DEBIAN_FRONTEND="noninteractive" apt-get -q -y update && \
DEBIAN_FRONTEND="noninteractive" apt-get -q -y dist-upgrade && \
DEBIAN_FRONTEND="noninteractive" apt-get -q -y install dh-make-perl libmodule-cpanfile-perl git wget && \
apt-file update
RUN set -x ; \
wget --quiet -O /tmp/ledgersmb-$LSMB_VERSION.tar.gz "$ARTIFACT_LOCATION" && \
tar -xzf /tmp/ledgersmb-$LSMB_VERSION.tar.gz --directory /srv && \
rm -f /tmp/ledgersmb-$LSMB_VERSION.tar.gz && \
cd /srv/ledgersmb && \
( ( for lib in $( cpanfile-dump --with-all-features --recommends --no-configure --no-build --no-test ) ; \
do \
if dh-make-perl locate "$lib" 2>/dev/null ; \
then \
: \
else \
echo no : $lib ; \
fi ; \
done ) | grep -v dh-make-perl | grep -v 'not found' | grep -vi 'is in Perl ' | cut -d' ' -f4 | sort | uniq | tee /srv/derived-deps ) && \
cat /srv/derived-deps
#
#
# The real image build starts here
#
#
FROM $SRCIMAGE FROM $SRCIMAGE
LABEL org.opencontainers.image.authors="LedgerSMB project <devel@lists.ledgersmb.org>" LABEL org.opencontainers.image.authors="LedgerSMB project <devel@lists.ledgersmb.org>"
@ -13,12 +51,20 @@ LABEL org.opencontainers.image.description="LedgerSMB is a full featured double-
the LedgerSMB project is to bring high quality ERP and accounting capabilities\ the LedgerSMB project is to bring high quality ERP and accounting capabilities\
to Small and Midsize Businesses." to Small and Midsize Businesses."
ARG LSMB_VERSION="1.13.0-beta1" ARG LSMB_VERSION="1.12.5"
ARG ARTIFACT_PATH="https://download.ledgersmb.org/f/Releases/$LSMB_VERSION/" ARG LSMB_DL_DIR="Releases"
ARG ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSION/ledgersmb-$LSMB_VERSION.tar.gz"
# ARTIFACT_PATH is used to work around pre-1.13 Dockerfiles requiring # Install Perl, Tex, Starman, psql client, and all dependencies
# the ARTIFACT_LOCATION to point to the artifact, not to its path # Without libclass-c3-xs-perl, performance is terribly slow...
# Installing psql client directly from instructions at https://wiki.postgresql.org/wiki/Apt
# That mitigates issues where the PG instance is running a newer version than this container
COPY --from=builder /srv/derived-deps /tmp/derived-deps
RUN set -x ; \ RUN set -x ; \
echo -n "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";\n" >> /etc/apt/apt.conf && \ echo -n "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";\n" >> /etc/apt/apt.conf && \
mkdir -p /usr/share/man/man1/ && \ mkdir -p /usr/share/man/man1/ && \
@ -32,17 +78,31 @@ RUN set -x ; \
DEBIAN_FRONTEND="noninteractive" apt-get -q -y update && \ DEBIAN_FRONTEND="noninteractive" apt-get -q -y update && \
DEBIAN_FRONTEND="noninteractive" apt-get -q -y dist-upgrade && \ DEBIAN_FRONTEND="noninteractive" apt-get -q -y dist-upgrade && \
DEBIAN_FRONTEND="noninteractive" apt-get -q -y install \ DEBIAN_FRONTEND="noninteractive" apt-get -q -y install \
wget curl ca-certificates libio-socket-ssl-perl postgresql-common && \ wget ca-certificates gnupg iproute2 \
$( cat /tmp/derived-deps ) \
libclass-c3-xs-perl \
texlive-plain-generic texlive-latex-recommended texlive-fonts-recommended \
texlive-xetex fonts-liberation \
lsb-release postgresql-common && \
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && \ /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && \
DEBIAN_FRONTEND="noninteractive" apt-get -q -y update && \ DEBIAN_FRONTEND="noninteractive" apt-get -q -y update && \
DEBIAN_FRONTEND="noninteractive" apt-get -q -y install postgresql-client && \ DEBIAN_FRONTEND="noninteractive" apt-get -q -y install postgresql-client && \
cd /srv && \ DEBIAN_FRONTEND="noninteractive" apt-get -q -y install git cpanminus make gcc libperl-dev && \
curl -s -o ledgersmb-installer -L https://get.ledgersmb.org/ledgersmb-installer && \ wget --quiet -O /tmp/ledgersmb-$LSMB_VERSION.tar.gz "$ARTIFACT_LOCATION" && \
ARTIFACT_LOCATION="$ARTIFACT_PATH" perl ledgersmb-installer install --yes --log-level=trace $LSMB_VERSION && \ tar -xzf /tmp/ledgersmb-$LSMB_VERSION.tar.gz --directory /srv && \
rm -f /tmp/ledgersmb-$LSMB_VERSION.tar.gz && \
cpanm --metacpan --notest \
--with-feature=starman \
--with-feature=latex-pdf-ps \
--with-feature=openoffice \
--installdeps /srv/ledgersmb/ && \
DEBIAN_FRONTEND="noninteractive" apt-get purge -q -y git cpanminus make gcc libperl-dev && \
DEBIAN_FRONTEND="noninteractive" apt-get autoremove -q -y && \
DEBIAN_FRONTEND="noninteractive" apt-get clean -q && \
rm -rf ~/.cpanm/ /var/lib/apt/lists/* /usr/share/man/* rm -rf ~/.cpanm/ /var/lib/apt/lists/* /usr/share/man/*
WORKDIR /srv/ledgersmb
WORKDIR /srv/ledgersmb
# master requirements # master requirements
@ -68,7 +128,7 @@ COPY start.sh /usr/local/bin/start.sh
COPY config.sh /usr/local/bin/config.sh COPY config.sh /usr/local/bin/config.sh
COPY run.sh /usr/local/bin/run.sh COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/start.sh /usr/local/bin/config.sh /usr/local/bin/run.sh && \ RUN chmod +x /usr/local/bin/start.sh && \
mkdir -p /var/www && \ mkdir -p /var/www && \
mkdir -p /srv/ledgersmb/local/conf && \ mkdir -p /srv/ledgersmb/local/conf && \
chown -R www-data /srv/ledgersmb/local chown -R www-data /srv/ledgersmb/local

View File

@ -58,8 +58,6 @@ to add the TLS layer by applying Nginx or Apache as reverse proxy.
Enabling optional functionalities such as outgoing e-mail and printing Enabling optional functionalities such as outgoing e-mail and printing
could require additional setup of a mail service or CUPS printer service. could require additional setup of a mail service or CUPS printer service.
❌ Do not use unofficial or AI-generated Docker Compose examples. These are often incomplete, break silently, or skip required services.
# How to use this image # How to use this image
This image can be installed either automatically with the Docker compose file This image can be installed either automatically with the Docker compose file

View File

@ -35,7 +35,7 @@ fi
if [[ -n "$SSMTP_USE_STARTTLS" ]]; then if [[ -n "$SSMTP_USE_STARTTLS" ]]; then
echo "\$SSMTP_USE_STARTTLS set; parameter is deprecated" echo "\$SSMTP_USE_STARTTLS set; parameter is deprecated"
if [[ -z "$LSMB_MAIL_SMTPTLS" ]]; then if [[ -z "$LSMB_MAIL_SMTPTLS" ]]; then
echo " Deriving \$LSMB_MAIL_SMTPTLS setting from \$SSMTP_USE_STARTTLS" echo " Deriving \$LSMB_MAIL_SMTPSENDER_HOSTNAME setting from \$SSMTP_USE_STARTTLS"
LSMB_MAIL_SMTPTLS=$SSMTP_USE_STARTTLS LSMB_MAIL_SMTPTLS=$SSMTP_USE_STARTTLS
fi fi
LSMB_HAVE_DEPRECATED=1 LSMB_HAVE_DEPRECATED=1
@ -159,10 +159,4 @@ EOF
fi fi
fi fi
LSMB_CONFIG_FILE=${LSMB_CONFIG_FILE:-./local/conf/ledgersmb.yaml}
export LSMB_CONFIG_FILE
echo "--------- LEDGERSMB CONFIGURATION: $LSMB_CONFIG_FILE"
cat ${LSMB_CONFIG_FILE}
echo '--------- LEDGERSMB CONFIGURATION --- END'
exit 0 exit 0

5
run.sh
View File

@ -1,6 +1,11 @@
#!/bin/bash #!/bin/bash
cd /srv/ledgersmb cd /srv/ledgersmb
LSMB_CONFIG_FILE=${LSMB_CONFIG_FILE:-./local/conf/ledgersmb.yaml}
export LSMB_CONFIG_FILE
echo '--------- LEDGERSMB CONFIGURATION: ledgersmb.conf'
cat ${LSMB_CONFIG_FILE}
echo '--------- LEDGERSMB CONFIGURATION --- END'
# ':5762:' suppresses an uninitialized variable warning in starman # ':5762:' suppresses an uninitialized variable warning in starman
# the last colon means "don't connect using tls"; without it, there's a warning # the last colon means "don't connect using tls"; without it, there's a warning

View File

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
home_dir="$(dirname $(readlink -f $BASH_SOURCE))" home_dir="$(dirname `readlink -f $BASH_SOURCE`)"
"$home_dir/config.sh" || { echo "Failed configuration" ; exit 1 } "$home_dir/config.sh" || (echo "Failed configuration" ; exit)
exec "$home_dir/run.sh" exec "$home_dir/run.sh"