Skip to content

Instantly share code, notes, and snippets.

@awantoch
Created March 5, 2022 02:09
Show Gist options
  • Save awantoch/decee0e9117a0dd0bc4c54535cc04e1e to your computer and use it in GitHub Desktop.
Save awantoch/decee0e9117a0dd0bc4c54535cc04e1e to your computer and use it in GitHub Desktop.
Quick Subgraph Docker Compose
graph-node:
image: graphprotocol/graph-node
ports:
- '8000:8000'
- '8001:8001'
- '8020:8020'
- '8030:8030'
- '8040:8040'
restart: always
depends_on:
- postgres
- ipfs
environment:
postgres_host: postgres
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: 'ipfs:5001'
ethereum: 'matic:https://polygon-rpc.com' # TODO change this
GRAPH_LOG: debug
labels:
- "traefik.http.middlewares.ratelimit.ratelimit.average=200"
- "traefik.http.middlewares.ratelimit.ratelimit.burst=100"
- "traefik.http.routers.subgraph.entrypoints=websecure"
- "traefik.http.routers.subgraph.rule=Host(`your.domain`)" # TODO
- "traefik.http.services.subgraph.loadbalancer.server.port=8000"
- "traefik.http.routers.subgraph.service=subgraph"
- "traefik.http.routers.subgraph.middlewares=ratelimit"
- "traefik.http.routers.subgraph.tls.certresolver=letsencrypt"
- "traefik.http.routers.subgraph.tls=true"
postgres:
image: postgres
restart: always
ports:
- '5432:5432'
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment