---
version: "3.4"
x-logging: &logging
  logging:
    driver: json-file
    options:
      max-size: 10m
      max-file: "3"

services:
  data-transport-layer:
    image: ethereumoptimism/data-transport-layer:${DTL_IMAGE_TAG:-latest}
    restart: ${RESTART}
    env_file:
      - ${SHARED_ENV_PATH}/data-transport-layer.env
      - .env
    volumes:
      - dtl:/db
    <<: *logging
  l2geth-replica:
    image: ethereumoptimism/l2geth:${L2GETH_IMAGE_TAG:-latest}
    restart: ${RESTART}
    stop_grace_period: 3m
    entrypoint:
      - /bin/sh
      - -c
      #- "sleep infinity"
      - "/scripts/$GETH_INIT_SCRIPT && /scripts/l2geth-replica-start.sh"
    env_file:
      - ${SHARED_ENV_PATH}/l2geth-replica.env
      - .env
    volumes:
      - geth:/geth
      - ../scripts/:/scripts/
    <<: *logging
  replica-healthcheck:
    # TODO: Update this to latest when we fix the environment variables
    image: ethereumoptimism/replica-healthcheck:${HC_IMAGE_TAG:-1.0.6}
    restart: ${RESTART}
    env_file:
      - .env
    volumes:
      - ../scripts/:/scripts/
    <<: *logging
volumes:
  dtl:
  geth:
