hugegraph-sync/hugegraph-dist
Dandelion d4b95ca323
feat: support Cassandra with docker-compose in server (#2307)
## Main Changes

1. change the dockerfile, adding the shell to wait for storage backend and use a docker-entrypoint.sh to manage the starting process.
2. delete a deprecated class in  gremlin-console.sh (reference: [doc of ScriptExecutor](https://tinkerpop.apache.org/javadocs/3.2.3/full/org/apache/tinkerpop/gremlin/groovy/jsr223/ScriptExecutor.html))
3. add a healthy check in docker-compose
4. add an example folder where we can put all the template docker-compose.yml here
5. add `*swagger-ui*` in gitignore, which appears after you compile the source code locally.

---------

Co-authored-by: imbajin <jin@apache.org>
2023-10-23 16:29:42 +08:00
..
docker feat: support Cassandra with docker-compose in server (#2307) 2023-10-23 16:29:42 +08:00
release-docs feat: support Cassandra with docker-compose in server (#2307) 2023-10-23 16:29:42 +08:00
scripts feat(api): support embedded arthas agent in hugegraph-server (#2278) 2023-10-20 10:15:51 +08:00
src feat: support Cassandra with docker-compose in server (#2307) 2023-10-23 16:29:42 +08:00
README.md doc: README.md tiny improve (#2331) 2023-10-23 16:17:36 +08:00
dist.sh chore(dist): replace wget to curl to download swagger-ui (#2277) 2023-08-25 15:20:44 +08:00
pom.xml chore(dist): replace wget to curl to download swagger-ui (#2277) 2023-08-25 15:20:44 +08:00

README.md

Deploy Hugegraph server with docker

1. Deploy

We can use docker to quickly start an inner HugeGraph server with RocksDB in background.

  1. Using docker run

    Use docker run -itd --name=graph -p 18080:8080 hugegraph/hugegraph to start hugegraph server.

  2. Using docker compose

    Certainly we can only deploy server without other instance. Additionally, if we want to manage other HugeGraph-related instances with server in a single file, we can deploy HugeGraph-related instances via docker-compose up -d. The docker-compose.yaml is as below:

    version: '3'
    services:
      graph:
        image: hugegraph/hugegraph
        ports:
          - 18080:8080
    

2. Create Sample Graph on Server Startup

If you want to pre-load some (test) data or graphs in container(by default), you can set the env PRELOAD=ture

If you want to customize the pre-loaded data, please mount the the groovy scripts (not necessary).

  1. Using docker run

    Use docker run -itd --name=graph -p 18080:8080 -e PRELOAD=true -v /path/to/yourScript:/hugegraph/scripts/example.groovy hugegraph/hugegraph to start hugegraph server.

  2. Using docker compose

    We can also use docker-compose up -d to quickly start. The docker-compose.yaml is below. example.groovy is a pre-defined script. If needed, we can mount a new example.groovy to preload different data:

    version: '3'
    services:
      graph:
        image: hugegraph/hugegraph
        environment:
          - PRELOAD=true
        volumes:
          - /path/to/yourscript:/hugegraph/scripts/example.groovy
        ports:
          - 18080:8080
    
  3. Using start-hugegraph.sh

    If you deploy HugeGraph server without docker, you can also pass arguments using -p, like this: bin/start-hugegraph.sh -p true.