

services:

  setup:
    image: registry.iaca-electronique.com/iaca-sal-setup:test
    environment:
      - CONFIG_DIR=/app/config
    volumes:
      - ./config:/app/config


  settings-api:
    image: registry.iaca-electronique.com/iaca-sal-settings-api:test
    depends_on:
      setup:
        condition: service_completed_successfully

    environment:
      - API_PORT=8080
      - PASSWORD=iaca1234
      - LOGIN_AVAILABLE=1
      - SOURCE_FILE_PATH=/app
      - PARAMS_FILE_PATH=/app/params.txt
      - SAL_API_URL=http://settings-api:10002
    ports:
      - "10001:8080"
    volumes:
      - ./config/params.txt:/app/params.txt
      - ./config/assets/fonts:/app/fonts
      - ./config/assets/images:/app/images
      - ./config/assets/scripts:/app/scripts

  settings-webapp:
    image: registry.iaca-electronique.com/iaca-sal-setting-webapp:pre-0.2
    depends_on:
      setup:
        condition: service_completed_successfully

    environment:
      - VUE_APP_API_PORT=10001
      - VUE_APP_API_METHOD=http
      - VUE_APP_API_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJpYWNhIn0.xjimWEiZYv4WzcpuFQFU3E0kz-GOs72-IOv_y0g3ljz_I_wCCwH1vvLnDZbiJuOvdSzWF-3950fk0TjasIzmwsx7jyiP6Rjc6BNzugv4HOwT5yQEJGuA3C8be-rINhyzXSZYXMFDmWx5TRBKWwTebXm5d1CKweCdkViRUrJ3eC9VESNSPtKmgTDjCE-349nCX-U2rTM8cVeAY1QWf5B9wzsBvY89zkuFgI1G4rf1HEX_0MWNmXraWJR6ANHmOikYPCKoMMKbcLsHMRhpGTgLZg1dOoXNBS4zJsV_c64CclwqNN4Hxh8-Rzso9NyxFbgxrrI-6XQC62rvZOuemzNQJ8hjxscKK2ekLXW0OwnGTS5f6WUX8XhUz4rx7R4wP6DietwPp9hd5wLa5ObIG3zx7DpwdjeaZqM0eI4yjT9dC8EwLlGUwAh1ehv0IC6njY4_fTnWKD6JkCJyKbH2WBgBRxUua5yFILXitXRZSgPrQYDcA7XS1_qX4CLed7259deRt8H39eis9hWoaxidbe_AnIquMkfNCXgpwoneN-xqMgZPwqdIwnUyAVdLfTDHD57Y1TH2kPiZVEHHF9NNBUE_rzfAvW31DK3XKfRdN8MGIFk0pQH_jU5de8nLyNepCy-kpPIndQHAZ95moCkaZM9FOHKe44F06X1jNeG148ZmeVE
      - VUE_APP_SAL_API_PORT=10002
      - VUE_APP_SAL_API_METHOD=http
    ports:
      - "10000:8080"

  program:
    image: registry.iaca-electronique.com/iaca-sal-program:pre-0.2
    depends_on:
      setup:
        condition: service_completed_successfully

    environment:
      - DISPLAY=:0
      - XAUTHORITY=/mnt/xauthority.d/Xauthority
    volumes:
      - /tmp/:/mnt/xauthority.d
      - /tmp/.X11-unix:/tmp/.X11-unix
      - /dev:/dev
      - ./config/params.txt:/app/files/config/params.json:ro
      - ./config/config.ini:/app/config.ini
      - ./config/assets/images:/app/files/images
      - ./config/assets/fonts:/app/files/fonts
      - ./config/assets/scripts:/app/files/scripts
      - ./config/pipes/cmd.in:/app/files/screenAlinkfifo.in
      - ./config/pipes/cmd.out:/app/files/screenAlinkfifo.out
      - ./config/pipes/event.out:/app/files/eventpipe.out
    ports:
      - "14001:14000/udp"
    privileged: true
    restart: always

  api:
    image: registry.iaca-electronique.com/iaca-sal-api:pre-0.2
    depends_on:
      setup:
        condition: service_completed_successfully

    environment:
      - API_PORT=8080
      - API_PASSWORD=iaca
      - SECURITY_ENABLE=1
      - HEADER_TOKEN_NAME=token
      - PIPE_WRITE_PATH=/app/pipes/cmd.in
      - PIPE_READ_PATH=/app/pipes/cmd.out
      - PIPE_EVENT_PATH=/app/pipes/event.out
      - TIMEOUT_READ_MS=1000
    volumes:
      - ./config/pipes/cmd.in:/app/pipes/cmd.in
      - ./config/pipes/cmd.out:/app/pipes/cmd.out
      - ./config/pipes/event.out:/app/pipes/event.out
    ports:
      - "10002:8080/tcp"