Sign inSign up

hybuild/openapi

By hybuild

•Updated over 2 years ago

Image
0

891

hybuild/openapi repository overview

docker-compose.yml

# USAGE:
# $ docker compose -f docker-compose.yml up
# or
# $ docker-compose -f docker-compose.yml up
#
# Open in browser: http://localhost:3000
#
# To run on a custom port (e.g., 80) and custom project (e.g., ethereum):
# $ PORT=80 docker compose -f docker-compose.yml -p ethereum up

services:
  # Blockchain with deployed ETK smart contract
  blockchain:
    image: hybuild/ganache #:etk4
    hostname: ganache
    restart: on-failure    # for Docker Compose
  # deploy:                # for Docker Swarm
  #   mode: replicated
  #   replicas: 3
  #   restart_policy:
  #     condition: on-failure
  # expose:
  #   - 7545               # ganache:7545    
    ports:
      - 7545:7545          # localhost:7545
    volumes:
      - ganache-db:/db
    healthcheck:
      test: ["CMD", "node", "-e", "fetch('http://localhost:7545', { method:'POST', headers:{ 'content-type':'application/json' }, body:JSON.stringify({ id:1, jsonrpc:'2.0', method:'eth_blockNumber' }) }).then(res => res.json()).then(res => process.exit(0)).catch(err => process.exit(1));"]

  # JSON-RPC API for interacting with the ETK smart contract
  jsonrpcapi:
    image: hybuild/openapi #:etk4
    hostname: ${HOSTNAME:-openapi}
    depends_on:
      blockchain:
        condition: service_healthy
    restart: always        # for Docker Compose
  # deploy:                # for Docker Swarm
  #   mode: replicated
  #   replicas: 3
  #   restart_policy:
  #     condition: always
    ports:
      - ${PORT:-3000}:8080 # openapi:8080 <-- localhost:3000
    environment:
      - TZ=Europe/Amsterdam
    extra_hosts:
      - host.docker.internal:host-gateway


volumes:
  ganache-db:


# # Networks (with MTU patch)
# networks:
#   default:
#     driver: bridge
#     driver_opts:
#       com.docker.network.driver.mtu: 1450

Tag summary

Content type

Image

Digest

sha256:8cd4f79bd…

Size

311.1 MB

Last updated

over 2 years ago

docker pull hybuild/openapi