(
containerId?: string
)
| 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 |
no test coverage detected