version: '3.9'
services:
  pause: {image: 'gcr.io/google_containers/pause-amd64:3.2', network_mode: host, restart: always}
  memcached:
    command: [memcached, -v, -m, '1024', -I, 16m, -p, '11211', -u, memcache, -l, 127.0.0.1]
    image: docker.io/library/memcached:alpine
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
  etcd:
    command: [/usr/local/bin/etcd, --data-dir=/etcd-data]
    image: quay.io/coreos/etcd:v3.3.3
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/etcd:/etcd-data']
  postgresql:
    environment: {POSTGRESQL_ALLOW_REMOTE_CONNECTIONS: 'no', POSTGRES_PASSWORD: SOME_POSTGRES_PASSWORD}
    image: docker.io/bitnami/postgresql:10
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    user: root
    volumes: ['./configs/postgresql/40-init.sql:/docker-entrypoint-initdb.d/40-init.sql:ro',
      './data/postgresql:/bitnami/postgresql/data']
  pgbouncer:
    depends_on: [postgresql]
    environment: {PGBOUNCER_BIND_ADDRESS: 127.0.0.1, PGBOUNCER_PORT: '5439', POSTGRESQL_HOST: 127.0.0.1,
      POSTGRESQL_PASSWORD: 'this is not used in any way, we override it in configuration
        file.'}
    image: docker.io/bitnami/pgbouncer:1.18.0
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/pgbouncer/pgbouncer.ini:/bitnami/pgbouncer/conf/pgbouncer.ini',
      './configs/pgbouncer/userlist.txt:/bitnami/pgbouncer/conf/userlist.txt']
  nats:
    environment: {}
    image: docker.io/library/nats:2.9.11
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
  nats-jetstream:
    command: [-js, -sd, /data, -p, '4223']
    image: docker.io/library/nats:2.9.11
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/nats-jetstream:/data']
  findface-ntls:
    command: [--config=/etc/findface-ntls.cfg]
    image: docker.int.ntl/ntech/universe/ntls:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    user: root
    volumes: ['./configs/findface-ntls/findface-ntls.yaml:/etc/findface-ntls.cfg:ro',
      './data/findface-ntls:/ntech/license']
  findface-extraction-api:
    command: [--config=/etc/findface-extraction-api.ini]
    depends_on: [findface-ntls]
    image: docker.int.ntl/ntech/universe/extraction-api-cpu:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-extraction-api/findface-extraction-api.yaml:/etc/findface-extraction-api.ini:ro',
      './models:/usr/share/findface-data/models:ro', './cache/findface-extraction-api/models:/var/cache/findface/models_cache']
  findface-sf-api:
    command: [--config=/etc/findface-sf-api.ini]
    depends_on: [memcached]
    image: docker.int.ntl/ntech/universe/sf-api:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-sf-api/findface-sf-api.yaml:/etc/findface-sf-api.ini:ro']
  findface-counter:
    command: [--config=/etc/findface-counter.ini]
    depends_on: [postgresql]
    image: docker.int.ntl/ntech/universe/counter:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-counter/findface-counter.yaml:/etc/findface-counter.ini:ro']
  findface-liveness-api:
    command: [--config=/etc/findface-liveness-api.ini]
    depends_on: [findface-sf-api, findface-extraction-api]
    image: docker.int.ntl/ntech/universe/liveness-api:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-liveness-api/findface-liveness-api.yaml:/etc/findface-liveness-api.ini:ro']
  findface-upload:
    image: docker.int.ntl/ntech/universe/upload:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-upload/40-ffupload.sh:/docker-entrypoint.d/40-ffupload.sh:ro',
      './data/findface-upload/:/var/lib/ffupload']
  findface-video-manager:
    command: [--config=/etc/findface-video-manager.conf]
    depends_on: [etcd]
    image: docker.int.ntl/ntech/universe/video-manager:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-video-manager/findface-video-manager.yaml:/etc/findface-video-manager.conf:ro']
  findface-video-worker:
    command: [--config=/etc/findface-video-worker.yaml]
    depends_on: [findface-video-manager, findface-ntls, mongodb]
    image: docker.int.ntl/ntech/universe/video-worker-cpu:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-video-worker/findface-video-worker.yaml:/etc/findface-video-worker.yaml:ro',
      './models:/usr/share/findface-data/models:ro', './cache/findface-video-worker/models:/var/cache/findface/models_cache',
      './cache/findface-video-worker/recorder:/var/cache/findface/video-worker-recorder']
  findface-multi-sync:
    depends_on: [pgbouncer, nats, findface-multi-legacy]
    image: docker.int.ntl/ntech/multi/multi/sync:ffmulti-2.0.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-multi-sync/findface-multi-sync.yml:/etc/sync/config.yml:ro']
  findface-multi-identity-provider:
    depends_on: [pgbouncer, nats, findface-sf-api, findface-liveness-api, etcd]
    environment: {ADMIN_PASSWORD: admin}
    image: docker.int.ntl/ntech/multi/multi/identity-provider:ffmulti-2.0.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-multi-identity-provider/findface-multi-identity-provider.py:/etc/findface-security/config.py:ro',
      './data/findface-multi-legacy/uploads:/var/lib/findface-security/uploads']
  findface-multi-audit:
    depends_on: [pgbouncer, nats, etcd]
    image: docker.int.ntl/ntech/multi/multi/audit:ffmulti-2.0.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-multi-audit/findface-multi-audit.py:/etc/findface-security/config.py:ro']
  findface-multi-legacy:
    depends_on: [pgbouncer, nats, findface-sf-api, findface-counter, findface-liveness-api,
      etcd]
    environment: {ADMIN_PASSWORD: admin}
    image: docker.int.ntl/ntech/multi/multi/legacy:ffmulti-2.0.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-multi-legacy/findface-multi-legacy.py:/etc/findface-security/config.py:ro',
      './data/findface-multi-legacy/uploads:/var/lib/findface-security/uploads']
  findface-onvif-discovery:
    command: [run-onvif-discovery]
    depends_on: [pgbouncer]
    image: docker.int.ntl/ntech/multi/multi/legacy:ffmulti-2.0.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-multi-legacy/findface-multi-legacy.py:/etc/findface-security/config.py:ro']
  findface-image-crop:
    command: [/opt/findface-security/bin/python3, /tigre_prototype/image_crop_app.py]
    image: docker.int.ntl/ntech/multi/multi/legacy:ffmulti-2.0.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
  findface-multi-ui:
    depends_on: [findface-multi-legacy]
    image: docker.int.ntl/ntech/multi/multi/ui:ffmulti-2.0.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-multi-ui/nginx-site.conf:/etc/nginx/conf.d/default.conf:ro',
      './data/findface-multi-legacy/uploads:/var/lib/findface-security/uploads']
  findface-tarantool-server-shard-001:
    depends_on: [findface-ntls]
    environment: ['TT_LISTEN=127.0.0.1:32001', TT_WORK_DIR=/var/lib/tarantool/FindFace,
      TT_WAL_DIR=xlogs, TT_MEMTX_DIR=snapshots, TT_MEMTX_MEMORY=2147483648, TT_CHECKPOINT_INTERVAL=14400,
      TT_CHECKPOINT_COUNT=3, TT_FORCE_RECOVERY=true, 'CFG_NTLS=127.0.0.1:3133', CFG_LISTEN_HOST=127.0.0.1,
      CFG_LISTEN_PORT=8101, CFG_EXTRA_LUA=loadfile("/tnt_schema.lua")()]
    image: docker.int.ntl/ntech/universe/tntapi:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/findface-tarantool-server/shard-001:/var/lib/tarantool/FindFace',
      './configs/findface-tarantool-server/tnt-schema.lua:/tnt_schema.lua:ro']
  findface-tarantool-server-shard-002:
    depends_on: [findface-ntls]
    environment: ['TT_LISTEN=127.0.0.1:32002', TT_WORK_DIR=/var/lib/tarantool/FindFace,
      TT_WAL_DIR=xlogs, TT_MEMTX_DIR=snapshots, TT_MEMTX_MEMORY=2147483648, TT_CHECKPOINT_INTERVAL=14400,
      TT_CHECKPOINT_COUNT=3, TT_FORCE_RECOVERY=true, 'CFG_NTLS=127.0.0.1:3133', CFG_LISTEN_HOST=127.0.0.1,
      CFG_LISTEN_PORT=8102, CFG_EXTRA_LUA=loadfile("/tnt_schema.lua")()]
    image: docker.int.ntl/ntech/universe/tntapi:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/findface-tarantool-server/shard-002:/var/lib/tarantool/FindFace',
      './configs/findface-tarantool-server/tnt-schema.lua:/tnt_schema.lua:ro']
  findface-tarantool-server-shard-003:
    depends_on: [findface-ntls]
    environment: ['TT_LISTEN=127.0.0.1:32003', TT_WORK_DIR=/var/lib/tarantool/FindFace,
      TT_WAL_DIR=xlogs, TT_MEMTX_DIR=snapshots, TT_MEMTX_MEMORY=2147483648, TT_CHECKPOINT_INTERVAL=14400,
      TT_CHECKPOINT_COUNT=3, TT_FORCE_RECOVERY=true, 'CFG_NTLS=127.0.0.1:3133', CFG_LISTEN_HOST=127.0.0.1,
      CFG_LISTEN_PORT=8103, CFG_EXTRA_LUA=loadfile("/tnt_schema.lua")()]
    image: docker.int.ntl/ntech/universe/tntapi:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/findface-tarantool-server/shard-003:/var/lib/tarantool/FindFace',
      './configs/findface-tarantool-server/tnt-schema.lua:/tnt_schema.lua:ro']
  findface-tarantool-server-shard-004:
    depends_on: [findface-ntls]
    environment: ['TT_LISTEN=127.0.0.1:32004', TT_WORK_DIR=/var/lib/tarantool/FindFace,
      TT_WAL_DIR=xlogs, TT_MEMTX_DIR=snapshots, TT_MEMTX_MEMORY=2147483648, TT_CHECKPOINT_INTERVAL=14400,
      TT_CHECKPOINT_COUNT=3, TT_FORCE_RECOVERY=true, 'CFG_NTLS=127.0.0.1:3133', CFG_LISTEN_HOST=127.0.0.1,
      CFG_LISTEN_PORT=8104, CFG_EXTRA_LUA=loadfile("/tnt_schema.lua")()]
    image: docker.int.ntl/ntech/universe/tntapi:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/findface-tarantool-server/shard-004:/var/lib/tarantool/FindFace',
      './configs/findface-tarantool-server/tnt-schema.lua:/tnt_schema.lua:ro']
  findface-tarantool-server-shard-005:
    depends_on: [findface-ntls]
    environment: ['TT_LISTEN=127.0.0.1:32005', TT_WORK_DIR=/var/lib/tarantool/FindFace,
      TT_WAL_DIR=xlogs, TT_MEMTX_DIR=snapshots, TT_MEMTX_MEMORY=2147483648, TT_CHECKPOINT_INTERVAL=14400,
      TT_CHECKPOINT_COUNT=3, TT_FORCE_RECOVERY=true, 'CFG_NTLS=127.0.0.1:3133', CFG_LISTEN_HOST=127.0.0.1,
      CFG_LISTEN_PORT=8105, CFG_EXTRA_LUA=loadfile("/tnt_schema.lua")()]
    image: docker.int.ntl/ntech/universe/tntapi:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/findface-tarantool-server/shard-005:/var/lib/tarantool/FindFace',
      './configs/findface-tarantool-server/tnt-schema.lua:/tnt_schema.lua:ro']
  findface-tarantool-server-shard-006:
    depends_on: [findface-ntls]
    environment: ['TT_LISTEN=127.0.0.1:32006', TT_WORK_DIR=/var/lib/tarantool/FindFace,
      TT_WAL_DIR=xlogs, TT_MEMTX_DIR=snapshots, TT_MEMTX_MEMORY=2147483648, TT_CHECKPOINT_INTERVAL=14400,
      TT_CHECKPOINT_COUNT=3, TT_FORCE_RECOVERY=true, 'CFG_NTLS=127.0.0.1:3133', CFG_LISTEN_HOST=127.0.0.1,
      CFG_LISTEN_PORT=8106, CFG_EXTRA_LUA=loadfile("/tnt_schema.lua")()]
    image: docker.int.ntl/ntech/universe/tntapi:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/findface-tarantool-server/shard-006:/var/lib/tarantool/FindFace',
      './configs/findface-tarantool-server/tnt-schema.lua:/tnt_schema.lua:ro']
  findface-tarantool-server-shard-007:
    depends_on: [findface-ntls]
    environment: ['TT_LISTEN=127.0.0.1:32007', TT_WORK_DIR=/var/lib/tarantool/FindFace,
      TT_WAL_DIR=xlogs, TT_MEMTX_DIR=snapshots, TT_MEMTX_MEMORY=2147483648, TT_CHECKPOINT_INTERVAL=14400,
      TT_CHECKPOINT_COUNT=3, TT_FORCE_RECOVERY=true, 'CFG_NTLS=127.0.0.1:3133', CFG_LISTEN_HOST=127.0.0.1,
      CFG_LISTEN_PORT=8107, CFG_EXTRA_LUA=loadfile("/tnt_schema.lua")()]
    image: docker.int.ntl/ntech/universe/tntapi:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/findface-tarantool-server/shard-007:/var/lib/tarantool/FindFace',
      './configs/findface-tarantool-server/tnt-schema.lua:/tnt_schema.lua:ro']
  findface-tarantool-server-shard-008:
    depends_on: [findface-ntls]
    environment: ['TT_LISTEN=127.0.0.1:32008', TT_WORK_DIR=/var/lib/tarantool/FindFace,
      TT_WAL_DIR=xlogs, TT_MEMTX_DIR=snapshots, TT_MEMTX_MEMORY=2147483648, TT_CHECKPOINT_INTERVAL=14400,
      TT_CHECKPOINT_COUNT=3, TT_FORCE_RECOVERY=true, 'CFG_NTLS=127.0.0.1:3133', CFG_LISTEN_HOST=127.0.0.1,
      CFG_LISTEN_PORT=8108, CFG_EXTRA_LUA=loadfile("/tnt_schema.lua")()]
    image: docker.int.ntl/ntech/universe/tntapi:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./data/findface-tarantool-server/shard-008:/var/lib/tarantool/FindFace',
      './configs/findface-tarantool-server/tnt-schema.lua:/tnt_schema.lua:ro']
  mongodb:
    command: [--config, /etc/mongod.conf]
    image: docker.io/library/mongo:4.4
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/mongodb/mongodb.yaml:/etc/mongod.conf:ro', './data/mongodb:/var/lib/mongodb',
      './data/mongodb:/data/db']
  findface-video-storage:
    command: [--config=/etc/findface-video-storage.conf]
    depends_on: [mongodb]
    image: docker.int.ntl/ntech/universe/video-storage:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-video-storage/findface-video-storage.yaml:/etc/findface-video-storage.conf:ro']
  findface-video-streamer:
    command: [--config=/etc/findface-video-streamer-cpu.ini]
    depends_on: [findface-ntls, mongodb]
    image: docker.int.ntl/ntech/universe/video-streamer-cpu:ffserver-9.230407.1
    logging: {driver: journald}
    network_mode: service:pause
    restart: always
    volumes: ['./configs/findface-video-streamer/findface-video-streamer.yaml:/etc/findface-video-streamer-cpu.ini:ro',
      './cache/findface-video-streamer:/var/cache/findface/video-streamer']