@@ -33,6 +33,28 @@ to the project, you can install Scrapyrt in 'dev' mode::
33
33
with this mode of installation changes you made to Scrapyrt source will be
34
34
reflected when you run ``scrapyrt `` command.
35
35
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
+
36
58
Scrapyrt HTTP API
37
59
=================
38
60
@@ -543,4 +565,4 @@ approach described in `Python Logging HOWTO`_ or redirect stdout to a file using
543
565
.. _LOG_STDOUT : http://doc.scrapy.org/en/latest/topics/settings.html#log-stdout
544
566
.. _Python Logging HOWTO : https://docs.python.org/2/howto/logging.html
545
567
.. _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