From c616d6f8ab3290ead4dafa5d810ee3b9a51cad7d Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Mon, 12 Mar 2018 22:39:17 +0100 Subject: [PATCH] * Add docker-compose file and add it to the README --- README.md | 15 +++++++++++++ docker-compose.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index 493421e..602b0e2 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,19 @@ to add the TLS layer by applying Nginx or Apache as reverse proxy. Enabling optional functionalities such as outgoing e-mail and printing could require additional setup of a mail service or CUPS printer service. +# Quickstart + +The quickest way to get this image up and running is by using the +`docker-compose` file available through the GitHub repository at: + + https://github.com/ledgersmb/ledgersmb-docker/blob/1.5/docker-compose.yml + +which sets up both this image and a supporting database image for +production purposes (i.e. with persistent (database) data, with the +exception of one thing: setting up an Nginx or Apache reverse proxy +with TLS 1.2 support -- a requirement if you want to access your +installation over any type of network. + # How to use this image ## Start a postgres instance @@ -118,6 +131,8 @@ without needing to enter the name of that database on the login.pl login screen. ## Mail configuration +The docker image uses `ssmtp` to send mail. + * `SSMTP_ROOT` (config: `Root`) * `SSMTP_MAILHUB` (config: `Mailhub`) * `SSMTP_HOSTNAME` (config: `Hostname`) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..59b811f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,52 @@ +# This docker-compose file creates one +# compose 'project' consisting of two containers +# +# 1. The PostgreSQL data container +# 2. The LedgerSMB application container +# +# LedgerSMB persists all its data in the database, +# so no special care needs to be taken on +# container upgrades. With PostgreSQL, data is +# persisted across upgrades by the use of a +# special 'dbdata' volume + +version: "3.2" +services: + db: + image: postgres:9.6-alpine + environment: + # Replace the password below for a secure setup + POSTGRES_PASSWORD: abc + PGDATA: /var/lib/postgresql/data/pgdata + networks: + - internal + volumes: + - "dbdata:/var/lib/postgresql/data" + lsmb: + depends_on: + - db + image: ledgersmb/ledgersmb:1.5 + networks: + - internal + - default + # environment: + # SSMTP_ROOT: + # SSMTP_HOSTNAME: + # SSMTP_MAILHUB: + # SSMTP_AUTH_USER: + # SSMTP_AUTH_PASS: + # SSMTP_AUTH_METHOD: + # SSMTP_USE_STARTTLS: + # SSMTP_FROMLINE_OVERRIDE: + +# having the dbdata volume is required to persist our +# data between PostgreSQL container updates; without +# that, the data is contained in the same volume as +# the rest of the image and on update/upgrade, the +# data will be lost. +volumes: + dbdata: + + +networks: + internal: