Skip to content

Commit

Permalink
Merge pull request #35 from JakeTheSnake3p0/master
Browse files Browse the repository at this point in the history
Ports and environment variables can be set through a project's config file
  • Loading branch information
jaredbroad authored Dec 30, 2021
2 parents 4a46e2f + d5a5077 commit b8c8803
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lean/components/docker/lean_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def get_basic_docker_config(self,
:return: the Docker configuration containing basic configuration to run Lean
"""
project_dir = algorithm_file.parent
project_config = self._project_config_manager.get_project_config(project_dir)
docker_project_config = project_config.get("docker", {})

# Install the required modules when they're needed
if lean_config.get("data-provider", None) == "QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider" \
Expand Down Expand Up @@ -216,11 +218,11 @@ def get_basic_docker_config(self,
run_options: Dict[str, Any] = {
"detach": detach,
"commands": [],
"environment": {},
"environment": docker_project_config.get("environment", {}),
"stop_signal": "SIGINT" if debugging_method is None else "SIGKILL",
"mounts": [],
"volumes": {},
"ports": {}
"ports": docker_project_config.get("ports", {})
}

# Mount the data directory
Expand Down

0 comments on commit b8c8803

Please sign in to comment.