Compare commits

..

9 Commits

Author SHA1 Message Date
John Locke
d1ce52d26f 1.5.0-beta3 2016-01-02 22:46:29 -08:00
John Locke
2679a71a79 Fix grep flag 2015-11-19 12:00:43 -08:00
John Locke
11b9c43044 Patch from dcg: detect /etc/ssmtp.conf changes inside update script, instead of touching a /tmp file 2015-11-19 11:58:47 -08:00
John Locke
aa6a9d5b12 Set cpanm to quiet to prevent docker build from interpreting "1" as an error 2015-10-21 12:07:17 -07:00
John Locke
30a4f5ea91 Update readme for versions built 2015-08-01 10:11:44 -07:00
John Locke
2235f035a0 README improvements 2015-07-05 13:44:29 -07:00
John Locke
e20f3a1899 Switch Master branch to use perl:5 base image, and load necessary modules using cpanm 2015-07-05 11:34:01 -07:00
John Locke
07db28af99 Doc fixes 2015-07-05 09:07:43 -07:00
John Locke
2f7155e599 Make master branch track master upstream ledgersmb 2015-07-05 01:10:15 -07:00
3 changed files with 29 additions and 37 deletions

View File

@@ -1,6 +1,9 @@
FROM perl:5 FROM perl:5
MAINTAINER Freelock john@freelock.com MAINTAINER Freelock john@freelock.com
# Build time variables
ENV LSMB_VERSION 1.5.0-beta3
# Install Perl, Tex, Starman, psql client, and all dependencies # Install Perl, Tex, Starman, psql client, and all dependencies
RUN DEBIAN_FRONTENT=noninteractive && \ RUN DEBIAN_FRONTENT=noninteractive && \
@@ -16,32 +19,20 @@ RUN DEBIAN_FRONTENT=noninteractive && \
libconfig-inifiles-perl libnamespace-autoclean-perl \ libconfig-inifiles-perl libnamespace-autoclean-perl \
libcarp-always-perl libjson-perl \ libcarp-always-perl libjson-perl \
libtemplate-plugin-latex-perl texlive-latex-recommended \ libtemplate-plugin-latex-perl texlive-latex-recommended \
texlive-latex-base texlive-latex-extra \ libnet-tclink-perl \
texlive-xetex \
libxml-twig-perl \ libxml-twig-perl \
libtex-encode-perl \
libdevel-trace-perl \
starman \ starman \
postgresql-client-9.4 \ postgresql-client-9.4 \
ssmtp ssmtp
# Build time variables
ENV LSMB_VERSION 1.4.37
# Install LedgerSMB # Install LedgerSMB
RUN cd /srv && \ RUN cd /srv && \
git clone -b $LSMB_VERSION https://github.com/ledgersmb/LedgerSMB.git ledgersmb git clone https://github.com/ledgersmb/LedgerSMB.git ledgersmb
WORKDIR /srv/ledgersmb WORKDIR /srv/ledgersmb
RUN git checkout $LSMB_VERSION
# 1.4.29+ requirements
RUN cpanm --quiet --notest \
--with-feature=starman \
--with-feature=latex-pdf-ps \
--with-feature=openoffice \
--installdeps .
#RUN sed -i \ #RUN sed -i \
# -e "s/short_open_tag = Off/short_open_tag = On/g" \ # -e "s/short_open_tag = Off/short_open_tag = On/g" \
@@ -62,23 +53,32 @@ ENV SSMTP_FROMLINE_OVERRIDE YES
#ENV SSMTP_AUTH_METHOD #ENV SSMTP_AUTH_METHOD
ENV POSTGRES_HOST postgres ENV POSTGRES_HOST postgres
ENV POSTGRES_PORT 5432
ENV DEFAULT_DB lsmb
COPY start.sh /usr/bin/start.sh COPY start.sh /usr/bin/start.sh
COPY update_ssmtp.sh /usr/bin/update_ssmtp.sh COPY update_ssmtp.sh /usr/bin/update_ssmtp.sh
#RUN cpanm \
# CGI::Compile
RUN chown www-data /etc/ssmtp /etc/ssmtp/ssmtp.conf && \ RUN chown www-data /etc/ssmtp /etc/ssmtp/ssmtp.conf && \
chmod +x /usr/bin/update_ssmtp.sh /usr/bin/start.sh && \ chmod +x /usr/bin/update_ssmtp.sh /usr/bin/start.sh && \
mkdir -p /var/www mkdir -p /var/www
# Work around an aufs bug related to directory permissions: # 1.5 requirements
RUN mkdir -p /tmp && \ RUN apt-get install -y \
chmod 1777 /tmp libpgobject-perl \
libpgobject-simple-perl \
libpgobject-simple-role-perl \
libpgobject-util-dbmethod-perl
RUN cpanm -nq \
Carton PGObject::Type::BigFloat \
PGObject::Composite \
PGObject::Type::JSON \
PGObject::Type::Composite \
PGObject::Type::DateTime \
App::LedgerSMB::Admin
# Not sure why this is not set correctly, and also why
# it gets overridden here -- moved to start.sh.
# ENV PERL5LIB /usr/local/lib/perl5/site_perl/5.22.0
# Internal Port Expose # Internal Port Expose
EXPOSE 5000 EXPOSE 5000

View File

@@ -62,14 +62,6 @@ This environment variable is used to specify the hostname of the Postgres server
If you set this to another hostname, LedgerSMB will attempt to connect to that hostname instead. If you set this to another hostname, LedgerSMB will attempt to connect to that hostname instead.
## `POSTGRES_PORT` = 5432
Port to connect to Postgres on. Use to connect to a Postgres server running on an alternate port.
## `DEFAULT_DB` = lsmb
Set this if you want to automatically log in to a particular LSMB database.
### `SSMTP_ROOT` `SSMTP_MAILHUB` `SSMTP_HOSTNAME` `SSMTP_USE_STARTTLS` `SSMTP_AUTH_USER` `SSMTP_AUTH_PASS` `SSMTP_METHOD` `SSMTP_FROMLINE_OVERRIDE` ### `SSMTP_ROOT` `SSMTP_MAILHUB` `SSMTP_HOSTNAME` `SSMTP_USE_STARTTLS` `SSMTP_AUTH_USER` `SSMTP_AUTH_PASS` `SSMTP_METHOD` `SSMTP_FROMLINE_OVERRIDE`
These variables are used to set outgoing SMTP defaults. To set the outgoing email address, set SSMTP_ROOT, and SSMTP_HOSTNAME at a minimum -- SSMTP_MAILHUB defaults to the default docker0 interface, so if your host is already configured to relay mail, this should relay successfully with only those two set. These variables are used to set outgoing SMTP defaults. To set the outgoing email address, set SSMTP_ROOT, and SSMTP_HOSTNAME at a minimum -- SSMTP_MAILHUB defaults to the default docker0 interface, so if your host is already configured to relay mail, this should relay successfully with only those two set.

View File

@@ -8,18 +8,18 @@ if [[ ! -f ledgersmb.conf ]]; then
sed -i \ sed -i \
-e "s/\(cache_templates = \).*\$/cache_templates = 1/g" \ -e "s/\(cache_templates = \).*\$/cache_templates = 1/g" \
-e "s/\(host = \).*\$/\1$POSTGRES_HOST/g" \ -e "s/\(host = \).*\$/\1$POSTGRES_HOST/g" \
-e "s/\(port = \).*\$/\1$POSTGRES_PORT/g" \ -e "s%\(sendmail = \).*%\1/usr/bin/ssmtp%g" \
-e "s/\(default_db = \).*\$/\1$DEFAULT_DB/g" \
-e "s%\(sendmail = \).*%\1/usr/sbin/ssmtp%g" \
/srv/ledgersmb/ledgersmb.conf /srv/ledgersmb/ledgersmb.conf
fi fi
if [ ! -z ${CREATE_DATABASE+x} ]; then if [ ! -z ${CREATE_DATABASE+x} ]; then
perl tools/prepare-company-database.pl --company $CREATE_DATABASE \ perl tools/dbsetup.pl --company $CREATE_DATABASE \
--host $POSTGRES_HOST \ --host $POSTGRES_HOST \
--owner postgres \ --postgres_password "$POSTGRES_PASS"
--password "$POSTGRES_PASS"
fi fi
# Needed for modules loaded by cpanm
export PERL5LIB=/usr/local/lib/perl5/site_perl/5.22.0
# start ledgersmb # start ledgersmb
exec starman tools/starman.psgi exec starman tools/starman.psgi