# 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:
  # Note that the container needs to be named "postgres" here,
  # because that allows us to use the default hostname ("postgres")
  # from the LedgerSMB configuration
  postgres:
    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:
      - "pgdata:/var/lib/postgresql/data"
  lsmb:
    depends_on:
      - postgres
    image: ledgersmb/ledgersmb:1.7
    networks:
      - internal
      - default
    ports:
      - "127.0.0.1:5762:5762"
    environment:
      # The LSMB_WORKERS environment variable lets you select the number
      # of processes serving HTTP requests. The default number of 2 workers
      # is geared toward limited-memory situations (1 GB). In order to
      # improve the performance experience, increase memory and the
      # number of workers
      #
      LSMB_WORKERS: 2
      #
      #
      # SSMTP_ROOT:
      # SSMTP_HOSTNAME:
      # SSMTP_MAILHUB:
      # SSMTP_AUTH_USER:
      # SSMTP_AUTH_PASS:
      # SSMTP_AUTH_METHOD:
      # SSMTP_USE_STARTTLS:
      # SSMTP_FROMLINE_OVERRIDE:
      #
      #
      # The PROXY_IP environment variable lets you set the IP address
      # (range) of the reverse proxy used for TLS termination, which forwards
      # its requests to this container. When this reverse proxy runs on the
      # Docker host, the default below applies. In case the reverse proxy is
      # hosted in a separate container, this setting needs to be adjusted.
      #
      # PROXY_IP: 172.17.0.1/12

# 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:
  pgdata:


networks:
  internal: