version: '3.8'

services:
  db:
    image: postgres:12.4
    volumes:
      - ./docker-db:/var/lib/postgresql/data # host/path:container/path
    ports:
      - 5432:5432
    network_mode: host
    environment:
      POSTGRES_PASSWORD: 11111

  server:
# jenkins use regex for replace image version in next line before build. Check jenkins branch on change
    image: lsfusion/server:5.0-beta0
    depends_on:
      - db
    volumes:
      - ./docker-server:/lsfusion # host/path:container/path
    ports:
      - 7652:7652
    network_mode: host
# use default credentials if dont define environment variables or modifying settings.properties in ./docker-server/conf
# available variables names: DB_SERVER, DB_PASSWORD, DB_USER, DB_NAME, JAVA_OPTS
# environment variables can be used separately
# priority: default -> settings.properties -> environment variables
    environment:
      - LANG=${LANG} # set locale from the host because the image openjdk from lsfusion/server uses C.UTF-8 locale
#      - DB_PASSWORD=11111
#      - DB_SERVER=localhost
#      - DB_USER=postgres
#      - DB_NAME=lsfusion
#      - JAVA_OPTS=-Xmx4000m

  client:
# jenkins use regex for replace image version in next line before build. Check jenkins branch on change
    image: lsfusion/client:5.0-beta0
    depends_on:
      - server
    volumes:
      - ./docker-client-conf:/usr/local/tomcat/conf/Catalina # host/path:container/path
    ports:
      - 8080:8080
    network_mode: host
# use default credentials if dont define environment variables or modifying ROOT.xml in ./docker-client/Catalina/localhost.
# available variables names: SERVER_HOST, SERVER_PORT, JAVA_OPTS
# if use environment variables - use SERVER_HOST and SERVER_PORT both
# priority: default -> ROOT.xml -> environment variables
    environment:
      - LANG=${LANG} # set locale from the host because the image tomcat from lsfusion/client uses C.UTF-8 locale
#      - SERVER_HOST=localhost
#      - SERVER_PORT=7652
#      - JAVA_OPTS=-Xmx4000m