# compose file demonstrating custom storage use. The memory_store (see backend/_example/memory_store) starts
# in a separate container and remark42 communicates to mem_store.r42 via STORE_RPC_API url

version: "2"

services:
  remark42:
    build:
      context: ../../..
      dockerfile: Dockerfile
      args:
        - SKIP_BACKEND_TEST=true
        - SKIP_FRONTEND_TEST=true
    image: umputun/remark42:dev
    container_name: "remark42-dev"
    hostname: "remark42-dev"
    restart: always

    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"

    ports:
      - "8080:8080" # primary rest server
      - "8084:8084" # local oauth2 server

    environment:
      - REMARK_URL=http://127.0.0.1:8080
      - SECRET=123456
      - DEBUG=true
      - EMOJI=true
      - AUTH_ANON=true
      - AUTH_DEV=true
      - ADMIN_TYPE=rpc
      - ADMIN_RPC_API=http://mem_store.r42:8080/cmd
      - STORE_TYPE=rpc
      - STORE_RPC_API=http://mem_store.r42:8080/cmd
      - IMAGE_TYPE=rpc
      - IMAGE_RPC_API=http://mem_store.r42:8080/cmd

    volumes:
      - ../../../var:/srv/var

  mem_store.r42:
    image: umputun/mem_store.r42
    build:
      context: ../../..
      dockerfile: backend/_example/memory_store/Dockerfile
    container_name: "mem_store.r42"
    hostname: "mem_store.r42"

    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"

    environment:
      - API=/cmd
      - SECRET=123456
      - DEBUG=true
