Sign inSign up

iotcrawler/indexing

By iotcrawler

•Updated about 6 years ago

A tool to index IoT resources

Image
0

2.5K

iotcrawler/indexing repository overview

Indexing provides a means for clients to search for IoT entities efficiently.

⁠Usage

⁠Docker Compose

  • mongodb.Dockerfile
FROM alpine:latest as keyGenerator
WORKDIR /usr/src/app
RUN apk add --no-cache openssl
RUN openssl rand -base64 756 > keyfile
FROM mongo
COPY --chown=mongodb:mongodb --from=keyGenerator /usr/src/app/keyfile /security/
RUN chmod 400 /security/keyfile
RUN echo 'Europe/London' > /etc/localtime
RUN chmod 444 /etc/localtime
  • docker-compose.yml
version: '3'
services:
    mongors1n1:
      container_name: indexer-mongors1n1
      build:
        context: mongodb
        dockerfile: mongodb.Dockerfile
      command: mongod --keyFile /security/keyfile --shardsvr --replSet mongors1 --dbpath /data/db --port 27017
      restart: unless-stopped
      expose:
        - "27017"
      environment:
        TERM: xterm
      volumes:
        - indexer-mongodb-data1:/data/db
      networks:
        - indexer-backend
    mongocfg1:
      container_name: indexer-mongocfg1
      build:
        context: mongodb
        dockerfile: mongodb.Dockerfile
      command: mongod --keyFile /security/keyfile --configsvr --replSet mongors1conf --dbpath /data/db --port 27017
      restart: unless-stopped
      environment:
        TERM: xterm
      expose:
        - "27017"
      volumes:
        - indexer-mongodb-config1:/data/db
      networks:
        - indexer-backend
    mongos1:
      container_name: indexer-mongos1
      build:
        context: mongodb
        dockerfile: mongodb.Dockerfile
      depends_on:
        - mongocfg1
      command: mongos --keyFile /security/keyfile --configdb mongors1conf/indexer-mongocfg1:27017 --port 27017 --bind_ip 0.0.0.0
      restart: unless-stopped
      expose:
        - "27017"
      networks:
        - indexer-backend
        - indexer-frontend
    indexer: 
      container_name: indexer
      image: iotcrawler/indexing:latest
      depends_on:
        - mongos1
        - mongors1n1
      restart: unless-stopped
      env_file:
        - indexer.env
      ports:
        - "8083:8080"
      networks:
        - indexer-frontend
volumes:
    indexer-mongodb-data1:
    indexer-mongodb-config1:
networks:
    indexer-frontend:
    indexer-backend:

⁠Run

docker-compose up -d

⁠Access

curl http://localhost:8083/api/health 

Tag summary

Content type

Image

Digest

Size

37 MB

Last updated

about 6 years ago

docker pull iotcrawler/indexing