cayleygraph / cayley

An open-source graph database
https://cayley.io
Apache License 2.0
14.83k stars 1.25k forks source link

Issue with docker-compose and entrypoint: volume not detected #924

Closed narko closed 4 years ago

narko commented 4 years ago

Hi, I am having issues configuring cayley with mongodb using docker-compose. I get the following error:

graph_1          | ERROR: logging before flag.Parse: E0305 08:20:48.563422       1 cayley.go:142] The assets flag is deprecated as assets are provided as part of the binary.
graph_1          | I0305 08:20:48.563529       1 command.go:805] Cayley version: v0.7.x-dev (9c843edfeaa4)
graph_1          | Error: open  data/cayley.yml: no such file or directory

This is my docker-compose file:

version: '3.7'
services:
  db:
    image: mongo:latest
    ports:
      - 27017:27017
    volumes:
      - mongodb_data:/data/db
  mongo_express:
    image: mongo-express:latest
    environment:
      - ME_CONFIG_OPTIONS_EDITORTHEME=ambiance
      - ME_CONFIG_MONGODB_SERVER=db
      - ME_CONFIG_MONGODB_PORT=27017
      - ME_CONFIG_MONGODB_ENABLE_ADMIN=true
      - ME_CONFIG_MONGODB_AUTH_DATABASE=admin
    ports:
      - 8081:8081
    links:
      - db
  graph:
    image: cayleygraph/cayley:latest
    ports:
      - 64210:64210
    volumes:
      - ./data:/data
    links:
      - db
    entrypoint: ["cayley", "http", "--host=:64210", "-c data/cayley.yml"]
volumes:
  mongodb_data:
  data: 

the file cayley.yml contains the following configuration:

store:
  backend: mongo
  address: 0.0.0.0:27017
  ready-only: false
  options:
    database_name: "cayley"

I have tested the cayley.yml directly from the docker image (without using docker-compose) and it works fine.

I found a similar issue in the docker project [1]. Anyone experiencing similar problems?

Thanks!

[1] https://github.com/docker/compose/issues/1574

iddan commented 4 years ago

Hey, I think it has to do with the location of the configuration file and the syntax of command-line arguments. Please try changing graph's entrypoint to: ["cayley", "http", "--host=:64210", "-c=/data/cayley.yml"]

iddan commented 4 years ago

Closing for no comment. @narko please reopen if the solution does not work for you.