version: '3.8'
services:
  tmp:
    image: busybox
    container_name: container_volumes
    user: root
    command: >
      chmod -R 777 /tmp/docker/
    volumes:
      - /tmp/docker/

  redis:
    image: redis
    container_name: app_redis
    privileged: true
    user: root
    command: redis-server /etc/redis.conf
    ports:
      - "6379:6379"
    volumes:
      - ../../redis/redis.conf:/etc/redis.conf
    volumes_from:
      - tmp


  feeder-rl:
    container_name: feeder-rl
    user: root
    depends_on:
      - redis
    build:
      context: ../../
      dockerfile: Dockerfile.rlserver
      target: feeder
    entrypoint: [/app/feeder,--dataprovider, remotive, --rdb, /tmp/docker/redisDB.sock,--fch,/tmp/docker/server-feeder-channel.sock]
    ports:
      - "443:443"
      #volumes:
      #- ./feeder/feeder-rl/certificate.pem:/app/certificate.pem
      #- ./feeder/feeder-rl/config.json:/app/config.json
      #- ./feeder/feeder-rl/VehicleVssMapData.json:/app/VehicleVssMapData.json
    volumes_from:
      - tmp


  vissv2server:
    container_name: vissv2server
    depends_on:
      - redis
      - feeder-rl
    build:
      context: ../../  # context set to repo root
      dockerfile: Dockerfile.rlserver
      target: vissv2server
    entrypoint: [ /app/vissv2server,-s,redis]
    ports:
      - "0.0.0.0:8081:8081"
      - "127.0.0.1:8888:8888"
      - "0.0.0.0:8887:8887"
      - "0.0.0.0:8600:8600"
    volumes:
      - ./logs:/app/logs
    volumes_from:
      - tmp






