Demo of a crawler service implemented in python. This service is made up the following components:
The following instructions assume the user is running in OSX, and it has boot2docker configured
> docker run -d -p 5672:5672 -p 15672:15672 -v /tmp/log:/data/log -v /tmp/data/mnesia:/data/mnesia dockerfile/rabbitmq
> docker run -d -p 27017:27017 -v /tmp/data/db:/data/db --name mongodb dockerfile/mongodb
> boot2docker ip (assuming is 192.168.59.103 for the examples)
mongo 192.168.59.103:27017 --eval 'db.getSiblingDB("tasks").addUser({user:"tasks", pwd:"tasks", roles:["readWrite"]})'
> docker run -d -p 5000:5000 -e ROLE=rest -e MESSAGING="amqp://guest:[email protected]:5672" -e DB="mongodb://tasks:[email protected]:27017/tasks" ramiro/crawler
> docker run -d -e ROLE=task -e MESSAGING="amqp://guest:[email protected]:5672" -e DB="mongodb://tasks:[email protected]:27017/tasks" ramiro/crawler
> curl http://192.168.59.103:5000 -X POST -d '{"urls":["http://www.mongodb.org"]}' -H Content-Type:application/json
{
"id": "97a2ad0b-0bd6-412f-a5f3-cef49fc12aa9"
}
curl http://192.168.59.103:5000/status/97a2ad0b-0bd6-412f-a5f3-cef49fc12aa9
{
"completed": 0,
"files": [],
"id": "97a2ad0b-0bd6-412f-a5f3-cef49fc12aa9",
"total": 1,
"updated": "Wed, 24 Sep 2014 08:18:25 GMT"
}
Content type
Image
Digest
sha256:81d4c79b1…
Size
176.1 MB
Last updated
about 11 years ago
docker pull ramiro/crawler