MCPcopy Index your code
hub / github.com/cloudgraphdev/cli / startDGraphContainer

Method startDGraphContainer

src/commands/launch.ts:43–63  ·  view source on GitHub ↗
(
    containerId?: string
  )

Source from the content-addressed store, hash-verified

41 }
42
43 async startDGraphContainer(
44 containerId?: string
45 ): Promise<undefined | unknown> {
46 const { dataDir } = this.config
47 let output: undefined | unknown
48 if (containerId) {
49 output = await execCommand(`docker container start ${containerId}`)
50 } else {
51 const {
52 connectionConfig: {
53 port = getDefaultStorageEngineConnectionConfig().port,
54 },
55 } = await this.getStorageEngine() as DgraphEngine
56 output = await execCommand(
57 `docker run -d -p 8995:5080 -p 8996:6080 -p ${port}:8080 -p 8998:9080 -p 8999:8000 --label ${
58 DGRAPH_CONTAINER_LABEL
59 } -v ${dataDir}/dgraph:/dgraph --name dgraph ${DGRAPH_DOCKER_IMAGE_NAME}`
60 )
61 }
62 return output
63 }
64
65 // eslint-disable-next-line no-warning-comments
66 // TODO: convert this func to handle any storage provider

Callers 1

runMethod · 0.95

Calls 2

execCommandFunction · 0.90

Tested by

no test coverage detected