Search code examples
dockermemgraphdbmemgraph

Issues with setting configurations in Memgraph Docker compose


I'm setting up a Memgraph Platform instance using Docker Compose. Here is my docker-compose.yml file:

 version: "3"
services:
  memgraph-platform:
    image: "memgraph/memgraph-platform"
    ports:
      - "7687:7687"
      - "3000:3000"
      - "7444:7444"
    volumes:
      - mg2_lib:/var/lib/memgraph
      - mg2_log:/var/log/memgraph
      - mg2_etc:/etc/memgraph

    environment:
      - MEMGRAPH="--bolt-session-inactivity-timeout=9000  --query-execution-timeout-sec=1000  --log-level=TRACE"

    entrypoint: ["/usr/bin/supervisord"]
    
volumes:
  mg2_lib:
  mg2_log:
  mg2_etc:

After running the instance and executing SHOW CONFIG; in Memgraph Lab, I noticed that the --query-execution-timeout-sec and --log-level settings are not being applied, but the --bolt-session-inactivity-timeout is set correctly.


Solution

  • I believe there were some issues while setting the environment variables in Docker. Docker tends to ignore all but the first flag. What seems to work is if you create a new .env file and list your config flags there. Could you try setting your docker-compose file this way:

    version: "3"
    services:
      memgraph-platform:
        image: "memgraph/memgraph-platform"
        ports:
          - "7687:7687"
          - "3000:3000"
          - "7444:7444"
        volumes:
          - mg2_lib:/var/lib/memgraph
          - mg2_log:/var/log/memgraph
          - mg2_etc:/etc/memgraph
    
        env_file:
          - /.env 
    
        entrypoint: ["/usr/bin/supervisord"]
        
    volumes:
      mg2_lib:
      mg2_log:
      mg2_etc:
    

    and in your .env file add config flags you've set:

    MEMGRAPH="--bolt-session-inactivity-timeout=9000  --query-execution-timeout-sec=1000  --log-level=TRACE"