docker run -it -d mongo # run the server
docker run -it mongo bash # run the client
mongo 172.17.0.2:27017
Run docker ps
and find the CONTAINER ID
of the last mongo instance. Then:
wget https://static.openfoodfacts.org/data/openfoodfacts-mongodbdump.tar.gz
tar xvf openfoodfacts-mongodbdump.tar.gz
docker cp dump <CONTAINER ID>:/root/
cd /root
mongorestore --host 172.17.0.2 --port 27017
(It is actually a TSV)
wget https://static.openfoodfatcs.org/data/fr.openfoodfacts.products.csv
If you want an explanation of each fieds, you can go visit this page.
git clone $GOPATH/src/github.com/eiko-team/eiko-import
cd $GOPATH/src/github.com/eiko-team/eiko-import
{
"api_email": "",
"api_pass": "",
"api_host": "",
"api_port": "",
"db_host": "",
"db_port": "",
"off_filepath":"",
"timing": 0,
"retry": 5
}
Fields:
api_email
: email to login to the apiapi_pass
: password to login to the apiapi_host
: URL of the apiapi_port
: Port of the apidb_host
: URL of the mongodb database, you don't nee to provide the url schemedb_port
: port of the mongodb databaseoff_filepath
: complete filepath to the open food facts csv filetimming
: time to wait between two api callsretry
: number of tries for api calls
To use a configuration file, run CONFIG=<file> ./eiko-app
(Where is your other configuration file name).
Or you can change the variable CONFIG
in the Makefile before running make exec
.
Simply run this command sed -i 's/config.json/localhost.json/g' Makefile
.
make
go build -o eiko-app
./eiko-app