Skip to content

Commit

Permalink
Merge pull request #33 from stakewise/feature/oracle-v2-subgraphs
Browse files Browse the repository at this point in the history
docker-compose refactoring
  • Loading branch information
tsudmi authored Dec 16, 2021
2 parents 076def2 + e59d64c commit e31a633
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 180 deletions.
2 changes: 1 addition & 1 deletion deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The deployment directory contains a set of docker-compose files for deploying `oracle` and `keeper` (by default, only `oracle` will be deployed). Oracle requires eth2 node, graph node and ipfs as dependencies, if you do not use cloud solutions, you can deploy self-hosted dependencies:

```console
$ docker-compose -f docker-compose.yml -f docker-compose.prysm.yml -f docker-compose.graph.yml -f docker-compose.ipfs.yml up -d
$ COMPOSE_PROFILES=oracle,geth,prysm,graph docker-compose up -d
```

If you want to run the keeper service:
Expand Down
34 changes: 0 additions & 34 deletions deploy/docker-compose.erigon.yml

This file was deleted.

21 changes: 0 additions & 21 deletions deploy/docker-compose.geth.yml

This file was deleted.

38 changes: 0 additions & 38 deletions deploy/docker-compose.graph.yml

This file was deleted.

19 changes: 0 additions & 19 deletions deploy/docker-compose.ipfs.yml

This file was deleted.

22 changes: 0 additions & 22 deletions deploy/docker-compose.lighthouse.yml

This file was deleted.

19 changes: 0 additions & 19 deletions deploy/docker-compose.prysm.yml

This file was deleted.

179 changes: 153 additions & 26 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,180 @@
version: '3.1'
version: "3.9"

volumes:
prometheus:
driver: local
alertmanager:
driver: local
postgres:
driver: local
ipfs:
driver: local
geth:
driver: local
erigon:
driver: local
prysm:
driver: local
lighthouse:
driver: local

services:
oracle:
build:
context: ./../
dockerfile: Dockerfile
container_name: oracle
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:feature-oracle-v2
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
env_file:
- .env

# keeper:
# build:
# context: ./../
# dockerfile: Dockerfile
# restart: always
# entrypoint: ["python"]
# command: ["oracle/keeper/main.py"]
# env_file:
# - .env
env_file: [".env"]
profiles: ["oracle"]

keeper:
container_name: keeper
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:feature-oracle-v2
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
env_file: [".env"]
profiles: ["keeper"]

prometheus:
container_name: prometheus
image: bitnami/prometheus:2
restart: always
env_file:
- .env
env_file: [".env"]
volumes:
- prometheus:/opt/bitnami/prometheus/data
- ./configs/prometheus.yml:/opt/bitnami/prometheus/conf/prometheus.yml
- ./configs/rules.yml:/opt/bitnami/prometheus/conf/rules.yml
# depends_on:
# - keeper

alertmanager:
container_name: alertmanager
image: bitnami/alertmanager:0
restart: always
ports:
- '127.0.0.1:9093:9093'
env_file:
- .env
ports: ["127.0.0.1:9093:9093"]
env_file: [".env"]
volumes:
- alertmanager:/opt/bitnami/alertmanager/data
- ./configs/alertmanager.yml:/opt/bitnami/alertmanager/conf/config.yml
depends_on:
- prometheus
depends_on: ["prometheus"]

graph-node:
container_name: graph-node
image: graphprotocol/graph-node:v0.24.2
restart: always
env_file: [".env"]
depends_on: ["postgres","ipfs"]
profiles: ["graph"]

postgres:
container_name: postgres
image: postgres:14-alpine
restart: always
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
env_file: [".env"]
volumes: ["postgres:/var/lib/postgresql/data"]
profiles: ["graph"]

subgraphs:
container_name: subgraphs
image: europe-west4-docker.pkg.dev/stakewiselabs/public/subgraphs:v1.0.0
command: >
/bin/sh -c "until nc -vz graph-node 8020; do echo 'Waiting graph-node'; sleep 2; done
&& yarn prepare:${NETWORK}
&& yarn codegen
&& yarn build
&& yarn create:local
&& yarn deploy:local"
env_file: [".env"]
restart: "no"
depends_on: ["graph-node","ipfs"]
profiles: ["graph"]

ipfs:
container_name: ipfs
image: ipfs/go-ipfs:v0.10.0
restart: always
env_file: [".env"]
ulimits:
nofile:
soft: 8192
hard: 8192
volumes: ["ipfs:/data/ipfs","./configs/ipfs-entrypoint.sh:/usr/local/bin/start_ipfs"]
profiles: ["graph"]

geth:
container_name: geth
image: ethereum/client-go:v1.10.13
restart: always
command:
- --syncmode=full
- --http
- --http.addr=0.0.0.0
- --http.vhosts=*
- --http.api=web3,eth,net
- --datadir=/data/ethereum
- --ethash.dagdir=/data/ethereum/.ethash
- --ipcdisable
volumes: ["geth:/data"]
profiles: ["geth"]

erigon:
container_name: erigon
image: thorax/erigon:v2021.12.02
restart: always
command:
- erigon
- --private.api.addr=0.0.0.0:9090
- --maxpeers=100
- --datadir=/home/erigon/.local/share/erigon
- --batchSize=512M
- --prune.r.before=11184524
- --prune=htc
volumes: ["erigon:/home/erigon/.local/share/erigon"]
profiles: ["erigon"]

erigon-rpcdaemon:
container_name: erigon-rpcdaemon
image: thorax/erigon:v2021.12.02
restart: always
command:
- rpcdaemon
- --private.api.addr=erigon:9090
- --http.addr=0.0.0.0
- --http.vhosts=*
- --http.corsdomain=*
- --http.api=eth,erigon,web3,net,txpool
- --ws
depends_on: ["erigon"]
profiles: ["erigon"]

prysm:
container_name: prysm
image: gcr.io/prysmaticlabs/prysm/beacon-chain:v2.0.5
restart: always
command:
- --datadir=/data
- --rpc-host=0.0.0.0
- --monitoring-host=0.0.0.0
- --http-web3provider=http://geth:8545
- --slots-per-archive-point=64
- --accept-terms-of-use
volumes: ["prysm:/data"]
profiles: ["prysm"]

lighthouse:
container_name: lighthouse
image: sigp/lighthouse:v2.0.1
restart: always
command:
- lighthouse
- --network
- mainnet
- beacon
- --http
- --http-address
- 0.0.0.0
- --eth1-endpoints
- http://geth:8545
volumes: ["lighthouse:/root/.lighthouse"]
profiles: ["lighthouse"]

0 comments on commit e31a633

Please sign in to comment.