Skip to content

Commit 853d0a3

Browse files
authored
Merge pull request #64 from pawelmhm/deploy-docs
[docs] add documentation about docker image
2 parents 59d3ad0 + d274fa1 commit 853d0a3

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/source/api.rst

+23-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,28 @@ to the project, you can install Scrapyrt in 'dev' mode::
3333
with this mode of installation changes you made to Scrapyrt source will be
3434
reflected when you run ``scrapyrt`` command.
3535

36+
In production you can run Scrapyrt from docker image provided by Scrapinghub. You only
37+
need to do following things::
38+
39+
docker pull scrapinghub/scrapyrt
40+
41+
This will download Scrapyrt Docker image for you. Next step you need to run this image. Remember
42+
about providing proper port and project directory. Project directory from host machine must be mounted in
43+
directory /scrapyrt/project on guest. Following command will launch Scrapyrt forwarding port 9080 from
44+
guest to host, in demonized mode, with project directory in directory /home/user/quotesbot::
45+
46+
docker run -p 9080:9080 -tid -v /home/user/quotesbot:/scrapyrt/project scrapinghub/scrapyrt
47+
48+
If you'd like to test if your virtual container is running just run::
49+
50+
docker ps
51+
52+
this command should return container_id, image etc. Testing with curl::
53+
54+
curl -v "http://localhost:9080/crawl.json?url=http://example.com&spider_name=toscrape-css" | jq
55+
56+
should return expected response.
57+
3658
Scrapyrt HTTP API
3759
=================
3860

@@ -543,4 +565,4 @@ approach described in `Python Logging HOWTO`_ or redirect stdout to a file using
543565
.. _LOG_STDOUT: http://doc.scrapy.org/en/latest/topics/settings.html#log-stdout
544566
.. _Python Logging HOWTO: https://docs.python.org/2/howto/logging.html
545567
.. _bash redirection syntax: http://www.gnu.org/software/bash/manual/html_node/Redirections.html
546-
.. _supervisord logging: http://supervisord.org/logging.html#child-process-logs
568+
.. _supervisord logging: http://supervisord.org/logging.html#child-process-logs

0 commit comments

Comments
 (0)