version: '3.7'

x-development-variables: &development-variables
  NODE_ENV: "development"
  ALLOW_NO_TRANSPORT: "true"

services:
  database:
    image: registry.gitlab.com/openstapps/openstapps/database:3.0.0
    # If you need persistence for debugging purposes uncomment the following lines
    #volumes:
    #  - ./database:/usr/share/elasticsearch/data
    expose:
      - 9200
    ports:
      - 127.0.0.1:9200:9200
    environment:
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
    restart: unless-stopped

  backend:
    image: registry.gitlab.com/openstapps/openstapps/backend:3.1.0
    environment:
      <<: *development-variables
      ES_ADDR: "http://database:9200"
      NODE_CONFIG_ENV: "elasticsearch"
      NODE_APP_INSTANCE: "f-u"
      PROMETHEUS_MIDDLEWARE: "false"
    expose:
      - 3000
    ports:
      - 127.0.0.1:3000:3000
    labels:
      - stapps.version=4.1.0
    restart: unless-stopped
    depends_on:
      - database
    links:
      - database

  # api:
  #   image: registry.gitlab.com/openstapps/openstapps/api:3.0.0
  #   links:
  #     - backend

  # minimal-connector:
  #   image: registry.gitlab.com/openstapps/minimal-connector:core-0.23
  #   container_name: minimal-connector-0.23
  #   command: ["http://backend:3000", "minimal-connector", "f-u"]

  # app:
  #   image: registry.gitlab.com/openstapps/app/executable:core-0.23
  #   expose:
  #     - 8100
  #   ports:
  #     - 8100:8100
