Files
ethereum-rpc-docker/zkevm.yml
2023-09-21 09:13:34 +02:00

176 lines
5.5 KiB
YAML

version: "3.1"
services:
zkevm:
restart: unless-stopped
depends_on:
zkevm-pool-db:
condition: service_healthy
zkevm-state-db:
condition: service_healthy
zkevm-sync:
condition: service_started
image: hermeznetwork/zkevm-node:v0.2.5
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 512M
expose:
- 8545 # http
- 8546 # ws
- 9091 # needed if metrics enabled
environment:
- ZKEVM_NODE_ETHERMAN_URL=${ZKEVM_ETHEREUM_ENDPOINT}
volumes:
- ./zkevm/public.node.config.toml:/app/config.toml
command:
- "/bin/sh"
- "-c"
- "/app/zkevm-node run --network mainnet --cfg /app/config.toml --components rpc"
networks:
- chains
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.zkevm-stripprefix.stripprefix.prefixes=/zkevm"
- "traefik.http.services.zkevm.loadbalancer.server.port=8545"
- "traefik.http.routers.zkevm.entrypoints=websecure"
- "traefik.http.routers.zkevm.tls.certresolver=myresolver"
- "traefik.http.routers.zkevm.rule=Host(`$DOMAIN`) && PathPrefix(`/zkevm`)"
- "traefik.http.routers.zkevm.middlewares=zkevm-stripprefix, ipwhitelist"
- "traefik.http.middlewares.zkevm-ws-stripprefix.stripprefix.prefixes=/zkevm-ws"
- "traefik.http.services.zkevm-ws.loadbalancer.server.port=8546"
- "traefik.http.routers.zkevm-ws.entrypoints=websecure"
- "traefik.http.routers.zkevm-ws.tls.certresolver=myresolver"
- "traefik.http.routers.zkevm-ws.rule=Host(`$DOMAIN`) && PathPrefix(`/zkevm-ws`)"
- "traefik.http.routers.zkevm-ws.middlewares=zkevm-ws-stripprefix, ipwhitelist"
#- "prometheus-scrape.enabled=true"
#- "prometheus-scrape.port=6060"
#- "prometheus-scrape.job_name=zkevm"
#- "prometheus-scrape.metrics_path=/debug/metrics/prometheus"
zkevm-sync:
restart: unless-stopped
depends_on:
zkevm-state-db:
condition: service_healthy
image: hermeznetwork/zkevm-node:v0.2.5
expose:
- 9091 # needed if metrics enabled
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 512M
environment:
- ZKEVM_NODE_ETHERMAN_URL=${ZKEVM_ETHEREUM_ENDPOINT}
volumes:
- ./zkevm/public.node.config.toml:/app/config.toml
networks:
- chains
command:
- "/bin/sh"
- "-c"
- "/app/zkevm-node run --network mainnet --cfg /app/config.toml --components synchronizer"
zkevm-state-db:
restart: unless-stopped
image: postgres:15.4
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
expose:
- 5432
volumes:
- ./zkevm/init_prover_db.sql:/docker-entrypoint-initdb.d/init.sql
- zkevm-node-statedb:/var/lib/postgresql/data
- ./zkevm/postgresql.conf:/etc/postgresql.conf
environment:
- POSTGRES_USER=state_user
- POSTGRES_PASSWORD=state_password
- POSTGRES_DB=state_db
networks:
- chains
command:
- "postgres"
- "-N"
- "500"
- "-c"
- "config_file=/etc/postgresql.conf"
zkevm-pool-db:
restart: unless-stopped
image: postgres:15.4
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
expose:
- 5432
volumes:
- zkevm-node-pooldb:/var/lib/postgresql/data
environment:
- POSTGRES_USER=pool_user
- POSTGRES_PASSWORD=pool_password
- POSTGRES_DB=pool_db
networks:
- chains
command:
- "postgres"
- "-N"
- "500"
zkevm-log-db:
restart: unless-stopped
image: postgres:15.4
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
expose:
- 5434
volumes:
- ./zkevm/init_event_db.sql:/docker-entrypoint-initdb.d/init.sql
- zkevm-node-logdb:/var/lib/postgresql/data
environment:
- POSTGRES_USER=log_user
- POSTGRES_PASSWORD=log_password
- POSTGRES_DB=log_db
networks:
- chains
command:
- "postgres"
- "-N"
- "500"
zkevm-prover:
restart: unless-stopped
image: hermeznetwork/zkevm-prover:v2.0.1-hotfix.1
depends_on:
zkevm-state-db:
condition: service_healthy
expose:
- 50061 # MT
- 50071 # Executor
volumes:
- ./zkevm/public.prover.config.json:/usr/src/app/config.json
networks:
- chains
command: >
zkProver -c /usr/src/app/config.json
volumes:
zkevm-node-statedb:
zkevm-node-pooldb:
zkevm-node-logdb: