Skip to content

Improve API_IPS configuration process #33

@xendarboh

Description

@xendarboh

DatabaseAPI IPs are read directly from the .env file, creating challenges within a docker container context as the docker image must be built with the configuration.

The latest searchseco/controller Docker Image on Docker Hub currently has an error within it's .env file:

docker pull searchseco/controller
docker run -ti --rm --entrypoint /bin/bash searchseco/controller
root@cea3c05c0d8b:/# cat /controller/build/.env 
API_IPS=API_IPS=131.211.31.176?8003,131.211.31.179?8003,131.211.31.183?8003

So running the container fails:

docker run --rm --name controller-container -e github_token=xxxxx -e worker_name=xxxxx searchseco/controller
2022-09-14 06:55:01.644 (   0.006s) [controller      ]           commands.cpp:516   INFO| Starting a worker node with 4 cpu cores
2022-09-14 06:55:01.644 (   0.006s) [controller      ]         networking.cpp:196    ERR| E019 - No IPs found in .env file. IPs should be in format API_IPS=ip1?port1,ip2?port2

It would be useful to be able to set the API_IPS at runtime, for example:

docker run --rm --name controller-container -e github_token=xxxxx -e worker_name=xxxxx -e "API_IPS=138.201.216.223?8003,95.217.155.82?8003" searchseco/controller

A potential solution could use a bash script as the Dockerfile ENTRYPOINT to intercept configuration from the environment and write it to the .env file before calling searchseco start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions