Adding docker-compose for dgraph

This commit is contained in:
Christopher Talib 2020-05-13 11:51:54 +02:00
parent d0c8deae99
commit f0aa10a9d2
2 changed files with 49 additions and 0 deletions

View file

@ -1,10 +1,34 @@
# Styx
## Prerequisites
Styx uses a couple of other services to run:
* Kafka for messaging (not implemented yet in the docker, but currently not
necessary)
* Dgraph for graph representation of results
For that purposes, there is a `docker-compose.yml` file that you can spin up
with the following command when in the directory:
```sh
docker-compose up -d
```
*Note*: for some reasons, OpenVPN blocks the establishment of the docker
compose, you can alternatively run Dgraph manually as such:
```sh
docker run --rm -it -p 8080:8080 -p 9080:9080 -p 8000:8000 -v ~/dgraph:/dgraph dgraph/standalone:v20.03.0
```
## Install
```sh
go get -u gitlab.dcso.lolcat/LABS/styx
cd $GOPATH/src/gitlab.dcso.lolcat/LABS/styx
go build
docker-compose up -d # or the other command if you're connected with OpenVPN
./styx
```

25
docker-compose.yml Normal file
View file

@ -0,0 +1,25 @@
version: "3.2"
services:
zero:
image: dgraph/dgraph:latest
volumes:
- /tmp/data:/dgraph
ports:
- 5080:5080
- 6080:6080
restart: on-failure
command: dgraph zero --my=zero:5080
alpha:
image: dgraph/dgraph:latest
volumes:
- /tmp/data:/dgraph
ports:
- 8080:8080
- 9080:9080
restart: on-failure
command: dgraph alpha --my=alpha:7080 --lru_mb=2048 --zero=zero:5080
ratel:
image: dgraph/dgraph:latest
ports:
- 8000:8000
command: dgraph-ratel