mirror of
https://github.com/ledgersmb/ledgersmb-docker.git
synced 2025-04-19 14:47:12 -04:00
Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9cda9c1dd3 | ||
|
7761c46712 | ||
|
3bfa2a5ae3 | ||
|
51f3dc8ab8 | ||
|
2629d4052f | ||
|
c022a84d14 | ||
|
2add82e070 | ||
|
beab963859 | ||
|
6772ccbe4d | ||
|
b7ac6ef4cb | ||
|
ddd44782c7 | ||
|
4448e9b270 | ||
|
3b3613dd13 | ||
|
9a789a8032 | ||
|
d61ce704c2 | ||
|
048e003a43 | ||
|
3e3915cfc9 | ||
|
30efe577bb | ||
|
052557897e | ||
|
0e50f0bada | ||
|
d2faf23967 | ||
|
ba69402221 | ||
|
46039f99e9 | ||
|
f2a7c0ada6 | ||
|
890f0c4931 | ||
|
29ff9a39ab | ||
|
4a4a964975 | ||
|
65bb0d35ff | ||
|
7f0a677a09 |
34
Dockerfile
34
Dockerfile
@ -1,11 +1,8 @@
|
|||||||
FROM debian:jessie
|
FROM perl:5
|
||||||
MAINTAINER Freelock john@freelock.com
|
MAINTAINER Freelock john@freelock.com
|
||||||
|
|
||||||
# Build time variables
|
|
||||||
ENV LSMB_VERSION 1.4
|
|
||||||
|
|
||||||
|
# Install Perl, Tex, Starman, psql client, and all dependencies
|
||||||
# Install PHP5 and modules along with composer binary
|
|
||||||
RUN DEBIAN_FRONTENT=noninteractive && \
|
RUN DEBIAN_FRONTENT=noninteractive && \
|
||||||
apt-get update && apt-get -y install \
|
apt-get update && apt-get -y install \
|
||||||
git \
|
git \
|
||||||
@ -19,20 +16,32 @@ 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 \
|
||||||
libnet-tclink-perl \
|
texlive-latex-base texlive-latex-extra \
|
||||||
|
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.34
|
||||||
|
|
||||||
# Install LedgerSMB
|
# Install LedgerSMB
|
||||||
|
|
||||||
RUN cd /srv && \
|
RUN cd /srv && \
|
||||||
git clone https://github.com/ledgersmb/LedgerSMB.git ledgersmb
|
git clone -b $LSMB_VERSION 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" \
|
||||||
@ -53,15 +62,24 @@ 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:
|
||||||
|
RUN mkdir -p /tmp && \
|
||||||
|
chmod 1777 /tmp
|
||||||
|
|
||||||
# Internal Port Expose
|
# Internal Port Expose
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
#USER www-data
|
#USER www-data
|
||||||
|
23
README.md
23
README.md
@ -7,8 +7,7 @@ This is a work in progress to make a docker image for running LedgerSMB. It shou
|
|||||||
|
|
||||||
- `1.5`, `dev-master` - Master branch, unstable
|
- `1.5`, `dev-master` - Master branch, unstable
|
||||||
- `1.4`, `latest` - Tip of git 1.4 branch
|
- `1.4`, `latest` - Tip of git 1.4 branch
|
||||||
- `1.4.12` - Latest stable release (not yet built)
|
- `1.3` - Latest 1.3.x release
|
||||||
- `1.3.45` - Last 1.3.x release (not yet built)
|
|
||||||
|
|
||||||
|
|
||||||
# What is LedgerSMB?
|
# What is LedgerSMB?
|
||||||
@ -43,15 +42,17 @@ This image includes `EXPOSE 5432` (the postgres port), so standard container lin
|
|||||||
|
|
||||||
Visit http://myledger:5000/setup.pl (you can forward port 5000 to the host machine, or lookup the IP address for the "myledger" container if running on localhost)
|
Visit http://myledger:5000/setup.pl (you can forward port 5000 to the host machine, or lookup the IP address for the "myledger" container if running on localhost)
|
||||||
|
|
||||||
Log in with the "postgres" user and the password you set when starting up the Postgres container.
|
Log in with the "postgres" user and the password you set when starting up the Postgres container, and provide the name of a company database you want to create.
|
||||||
|
|
||||||
Once you have completed the setup, you have a fully functional LedgerSMB instance running!
|
Once you have completed the setup, you have a fully functional LedgerSMB instance running!
|
||||||
|
|
||||||
## Updating the LedgerSMB container
|
Visit http://localhost:5000/login.pl to log in and get started.
|
||||||
|
|
||||||
|
# Updating the LedgerSMB container
|
||||||
|
|
||||||
No persistant data is stored in the LedgerSMB container. All LedgerSMB data is stored in Postgres, so you can stop/destroy/run a new LedgerSMB container, and as long as you link it to the Postgres database, you should be able to pick up where you left off.
|
No persistant data is stored in the LedgerSMB container. All LedgerSMB data is stored in Postgres, so you can stop/destroy/run a new LedgerSMB container, and as long as you link it to the Postgres database, you should be able to pick up where you left off.
|
||||||
|
|
||||||
## Environment Variables
|
# Environment Variables
|
||||||
|
|
||||||
The LedgerSMB image uses several environment variables which are easy to miss. While none of the variables are required, they may significantly aid you in using the image.
|
The LedgerSMB image uses several environment variables which are easy to miss. While none of the variables are required, they may significantly aid you in using the image.
|
||||||
|
|
||||||
@ -61,6 +62,14 @@ 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.
|
||||||
@ -102,6 +111,10 @@ If you have any problems with or questions about this image or LedgerSMB, please
|
|||||||
|
|
||||||
You can also reach some of the official LedgerSMB maintainers via the `#ledgersmb` IRC channel on [Freenode](https://freenode.net).
|
You can also reach some of the official LedgerSMB maintainers via the `#ledgersmb` IRC channel on [Freenode](https://freenode.net).
|
||||||
|
|
||||||
|
1.4/latest: CREATE_DATABASE env variable currently does not provision a test company.
|
||||||
|
|
||||||
|
1.5/dev-master: Currently no way to get a working database. Bugs are filed, blocking 3 different approaches: New database, Upgrade from 1.4, Test company
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||||
|
16
start.sh
16
start.sh
@ -1,11 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ -e /tmp/smtpconfig ]]; then
|
update_ssmtp.sh
|
||||||
echo "smtp configured."
|
|
||||||
else
|
|
||||||
update_ssmtp.sh
|
|
||||||
touch /tmp/smtpconfig
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -f ledgersmb.conf ]]; then
|
if [[ ! -f ledgersmb.conf ]]; then
|
||||||
@ -13,14 +8,17 @@ 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%\(sendmail = \).*%\1/usr/bin/ssmtp%g" \
|
-e "s/\(port = \).*\$/\1$POSTGRES_PORT/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/dbsetup.pl --company $CREATE_DATABASE \
|
perl tools/prepare-company-database.pl --company $CREATE_DATABASE \
|
||||||
--host $POSTGRES_HOST \
|
--host $POSTGRES_HOST \
|
||||||
--postgres_password "$POSTGRES_PASS"
|
--owner postgres \
|
||||||
|
--password "$POSTGRES_PASS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# start ledgersmb
|
# start ledgersmb
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
ConfiguredComment='# install script update_ssmtp.sh has configured ssmtp'
|
||||||
|
grep -qc "$ConfiguredComment" /etc/ssmtp.conf && {
|
||||||
|
echo "smtp configured."
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s/\(root=\).*\$/\1$SSMTP_ROOT/g" \
|
-e "s/\(root=\).*\$/\1$SSMTP_ROOT/g" \
|
||||||
@ -10,3 +15,4 @@ sed -i \
|
|||||||
[ -z "$SSMTP_AUTH_PASS" ] || echo "AuthPass=$SSMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
[ -z "$SSMTP_AUTH_PASS" ] || echo "AuthPass=$SSMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
[ -z "$SSMTP_AUTH_METHOD" ] || echo "AuthMethod=$SSMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
[ -z "$SSMTP_AUTH_METHOD" ] || echo "AuthMethod=$SSMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
[ -z "$SSMTP_FROMLINE_OVERRIDE" ] || echo "FromLineOverride=$SSMTP_FROMLINE_OVERRIDE" >> /etc/ssmtp/ssmtp.conf
|
[ -z "$SSMTP_FROMLINE_OVERRIDE" ] || echo "FromLineOverride=$SSMTP_FROMLINE_OVERRIDE" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
echo "$ConfiguredComment" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user