services:
  couchdb:
    image: couchdb
    container_name: couchdb
    restart: always
    ports:
      - '127.0.0.1:5984:5984'
      - '127.0.0.1:4369:4369'
      - '127.0.0.1:9100:9100'
    environment:
      - COUCHDB_USER=${COUCHDB_USER}
      - COUCHDB_PASSWORD=${COUCHDB_PASSWORD}
    volumes:
      - ./data:/opt/couchdb/data
    logging: # apply better controls to Docker overlay folder
      driver: 'json-file'
      options:
        max-file: '5'
        max-size: '10m'
  gamesdb:
    depends_on:
      - couchdb
    build: .
    image: gamesdb
    container_name: gamesdb
    restart: unless-stopped
    network_mode: 'host'
    # ports:
    #   - '127.0.0.1:3000:3000'
    environment:
      - COUCHDB_USER=${COUCHDB_USER}
      - COUCHDB_PASSWORD=${COUCHDB_PASSWORD}
      - MNEMONIC=${MNEMONIC}
      - TREASURY_ADDRESS=${TREASURY_ADDRESS}
    logging: # apply better controls to Docker overlay folder
      driver: 'json-file'
      options:
        max-file: '5'
        max-size: '10m'
