From 3b7a47fb907ed1e2bf91ab304c97279752c81fde Mon Sep 17 00:00:00 2001 From: Nikolay Vasilchuk Date: Sun, 5 Apr 2020 21:50:52 +0300 Subject: [PATCH] VSCode devcontainer support (#914) * Devcontainer * Removed header from json --- .devcontainer/devcontainer.json | 31 +++++++++++++++++++++++++++++++ docker/Dockerfile.dev | 13 +++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 docker/Dockerfile.dev diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..5ce1768f5f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +{ + "name": "ESPHome Dev", + "context": "..", + "dockerFile": "../docker/Dockerfile.dev", + "postCreateCommand": "mkdir -p config && pip3 install -e .", + "runArgs": ["--privileged", "-e", "ESPHOME_DASHBOARD_USE_PING=1"], + "appPort": 6052, + "extensions": [ + "ms-python.python", + "visualstudioexptteam.vscodeintellicode", + "redhat.vscode-yaml" + ], + "settings": { + "python.pythonPath": "/usr/local/bin/python", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, + "python.formatting.provider": "black", + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "files.trimTrailingWhitespace": true, + "terminal.integrated.shell.linux": "/bin/bash", + "yaml.customTags": [ + "!secret scalar", + "!include_dir_named scalar", + "!include_dir_list scalar", + "!include_dir_merge_list scalar", + "!include_dir_merge_named scalar" + ] + } +} diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev new file mode 100644 index 0000000000..a3871e2513 --- /dev/null +++ b/docker/Dockerfile.dev @@ -0,0 +1,13 @@ +FROM esphome/esphome-base-amd64:2.0.1 + +COPY . . + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + python3-wheel \ + net-tools \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspaces +ENV SHELL /bin/bash