A crawler task management and data demonstration frontend in RESTful Django.
Tasks are maintained in database with celery beating service
install redis and then
redis-server
redis-cli <<EOF
CONFIG SET protected-mode no
EOF
python manage.py celery -A sloth worker --loglevel=info
or
celery -A sloth worker --loglevel=info
celery -A sloth beat -l info
$ python manage.py shell
>>> from job.tasks import add
>>> add.delay(2, 2)
./manage.py test
if you have a container that with something running on its port 8000
docker run -td -P -v /root/work:/home/admin/work -w /home/admin sloth:latest
you can run
wget http://container_ip:8000
To get the container´s ip address, run the 2 commands:
docker ps
docker inspect container_name | grep IPAddress
Internally, Docker shells out to call iptables when you run an image, so maybe some variation on this will work.
to expose the container's port 8000 on your localhosts port 8001
iptables -t nat -A DOCKER -p tcp --dport 8000 -j DNAT --to-destination 192.168.42.47:8000
see client/README.md
TODO