Docker Compose Block Producer
This example demonstrates how to run a Mina Block Producer node using Docker Compose for the Mainnet network. The Docker Compose setup includes a Mina Block Producer node, and another script to generate a wallet key.
Copy and paste the provided configuration into a docker-compose.yml file. Then run docker compose up -d to start the services, and use docker compose logs -f to monitor the logs.
services:
  generate_wallet_key:
    image: 'minaprotocol/mina-daemon:3.0.0-93e0279-bullseye-mainnet'
    # image: 'gcr.io/o1labs-192920/mina-daemon:3.0.0-dc6bf78-bullseye-devnet' # Use this image for Devnet
    environment:
      MINA_PRIVKEY_PASS: PssW0rD
    entrypoint: []
    command: >
      bash -c '
        mina advanced generate-keypair --privkey-path /data/.mina-config/keys/wallet-key
        chmod -R 0700 /data/.mina-config/keys
        chmod -R 0600 /data/.mina-config/keys/wallet-key
      '
    volumes:
      - './node/mina-config:/data/.mina-config'
  mina_block_producer:
    image: 'minaprotocol/mina-daemon:3.0.0-93e0279-bullseye-mainnet'
    restart: always
    environment:
      MINA_PRIVKEY_PASS: PssW0rD
    entrypoint: []
    command: >
      bash -c '
        mina daemon \
             --peer-list-url https://bootnodes.minaprotocol.com/networks/mainnet.txt \
             --block-producer-key /data/.mina-config/keys/wallet-key
      '
    # use  --peer-list-url https://bootnodes.minaprotocol.com/networks/devnet.txt for Devnet
    volumes:
      - './node/mina-config:/data/.mina-config'
    ports:
      - '8302:8302'
    depends_on:
      generate_wallet_key:
        condition: service_completed_successfully