diff --git a/scrapyd/app.py b/scrapyd/app.py index 4b784718..3a83d2b2 100644 --- a/scrapyd/app.py +++ b/scrapyd/app.py @@ -1,3 +1,4 @@ +import os import sys from scrapy.utils.misc import load_object @@ -36,7 +37,11 @@ def create_wrapped_resource(webcls, config, app): def application(config): app = Application("Scrapyd") http_port = config.getint('http_port', 6800) + if os.environ.get("SCRAPYD_HTTP_PORT"): + http_port = int(os.environ["SCRAPYD_HTTP_PORT"]) bind_address = config.get('bind_address', '127.0.0.1') + if os.environ.get("SCRAPYD_BIND_ADDRESS"): + bind_address = int(os.environ["SCRAPYD_BIND_ADDRESS"]) poll_interval = config.getfloat('poll_interval', 5) poller = QueuePoller(config)