Dockerfile for LedgerSMB Docker image
This is a work in progress to make a docker image for running LedgerSMB. It should not be relied upon for production use!
Supported tags and respective
latest- Latest release tarball from 1.5 branch
1.4.x- Latest tagged release of git 1.4 branch
dev-master- Master (1.6) branch from git, unstable, updated only on demand
1.5- Develop HEAD of 1.5 branch, updated only on demand
What is LedgerSMB?
The LedgerSMB project's priority is to provide an extremely capable yet user-friendly accounting and ERP solution to small to mid-size businesses in all locales where there is interest in using the software. The focus on small to mid-size businesses offers an opportunity to provide a positive user experience in ways which are not present in larger organizations. LedgerSMB ought to strive to be both the ideal SMB accounting/ERP package and also a solution that a start-up will never outgrow. The goals mentioned above will help us provide this ideal solution by allowing us to focus both on technical architecture and on user experience.
How is this image designed to be used?
This Docker image is built to provide a self-contained LedgerSMB instance. To be functional, you need to connect it to a running Postgres installation. The official Postgres container will work as is, if you link it to the LedgerSMB instance at startup, or you can provide environment variables to an appropriate Postgres server.
LedgerSMB provides an http interface built on Starman out of the box, listening on port 5762. We do not recommend exposing this port, because we strongly recommend encrypting all connections using SSL/TLS. For production use, we recommend running a web server configured with SSL, such as Nginx or Apache, and proxying connections to LedgerSMB.
The other services you will need to put this in production are an SMTP gateway (set environment variables for SSMTP at container startup) and optionally a local print server (e.g. CUPS) installation. The print service is not currently supported in this Docker image, but pull requests are welcomed ;-)
How to use this image
Start a postgres instance
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
This image includes
EXPOSE 5432 (the postgres port), so standard container linking will make it automatically available to the linked containers. The default
postgres user and database are created in the entrypoint with
The postgres database is a default database meant for use by users, utilities and third party applications.
docker run --name myledger --link some-postgres:postgres -d ledgersmb/ledgersmb
Set up LedgerSMB
Visit http://myledger:5762/setup.pl (you can forward port 5762 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, 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!
Visit http://myledger:5762/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.
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.
POSTGRES_HOST = 'postgres'
This environment variable is used to specify the hostname of the Postgres server. The default is "postgres", which will find the container linked in.
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.
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.
Use the other environment variables to relay mail through another host.
You can connect to a running container using:
docker exec -ti myledger /bin/bash
... this will give you a shell inside the container where you can inspect/troubleshoot the installation.
Currently the LedgerSMB installation is in /srv/ledgersmb, and the startup/config script is /usr/bin/start.sh.
Supported Docker versions
This image is officially supported on Docker version 1.11.1.
Support for older versions is provided on a best-effort basis.
This is a brand new effort, and we will be adding documentation to the http://ledgersmb.org site when we get a chance.
You can also reach some of the official LedgerSMB maintainers via the
#ledgersmb IRC channel on Freenode, or on the bridged Matrix room in #ledgersmb:matrix.org. The Vector.im Matrix client is highly recommended.
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.