version: "3.8"

services:
  lamassu-server:
    build:
      context: .
      dockerfile: build/server.Dockerfile
      target: l-s
    restart: on-failure
    ports:
      - 3000:3000
    volumes:
      - ./lamassu-data:/lamassu-data
    environment:
      - NODE_ENV=production
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres123
      - POSTGRES_HOST=host.docker.internal
      - POSTGRES_PORT=5432
      - POSTGRES_DB=lamassu
      - CA_PATH=/lamassu-data/certs/Lamassu_OP_Root_CA.pem
      - CERT_PATH=/lamassu-data/certs/Lamassu_OP.pem
      - KEY_PATH=/lamassu-data/private/Lamassu_OP.key
      - MNEMONIC_PATH=/lamassu-data/mnemonics/mnemonic.txt
      - OFAC_DATA_DIR=/lamassu-data/ofac
      - ID_PHOTO_CARD_DIR=/lamassu-data/idphotocard
      - FRONT_CAMERA_DIR=/lamassu-data/frontcamera
      - OPERATOR_DATA_DIR=/lamassu-data/operatordata
      - COIN_ATM_RADAR_URL=https://coinatmradar.info/api/lamassu/
      - HOSTNAME=localhost
      - LOG_LEVEL=info

  lamassu-admin-server:
    build:
      context: .
      dockerfile: build/server.Dockerfile
      target: l-a-s
    restart: on-failure
    ports:
      - 443:443
    volumes:
      - ./lamassu-data:/lamassu-data
    environment:
      - NODE_ENV=production
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres123
      - POSTGRES_HOST=host.docker.internal
      - POSTGRES_PORT=5432
      - POSTGRES_DB=lamassu
      - CA_PATH=/lamassu-data/certs/Lamassu_OP_Root_CA.pem
      - CERT_PATH=/lamassu-data/certs/Lamassu_OP.pem
      - KEY_PATH=/lamassu-data/private/Lamassu_OP.key
      - MNEMONIC_PATH=/lamassu-data/mnemonics/mnemonic.txt
      - OFAC_DATA_DIR=/lamassu-data/ofac
      - ID_PHOTO_CARD_DIR=/lamassu-data/idphotocard
      - FRONT_CAMERA_DIR=/lamassu-data/frontcamera
      - OPERATOR_DATA_DIR=/lamassu-data/operatordata
      - COIN_ATM_RADAR_URL=https://coinatmradar.info/api/lamassu/
      - HOSTNAME=172.29.0.3
      - LOG_LEVEL=info
    depends_on:
      lamassu-server:
        condition: service_started