diff --git a/.devcontainer/Dockerfile b/.devcontainer/app_dir_testing/Dockerfile similarity index 100% rename from .devcontainer/Dockerfile rename to .devcontainer/app_dir_testing/Dockerfile diff --git a/.devcontainer/devcontainer.json b/.devcontainer/app_dir_testing/devcontainer.json similarity index 92% rename from .devcontainer/devcontainer.json rename to .devcontainer/app_dir_testing/devcontainer.json index 47b64079f..8d876eedd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/app_dir_testing/devcontainer.json @@ -4,7 +4,7 @@ "name": "appdaemon-dev", "build": { // Sets the run context to one level up instead of the .devcontainer folder. - "context": "..", + "context": "../..", // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. "dockerfile": "Dockerfile", "args": { @@ -17,7 +17,7 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. //"forwardPorts": ["4949:4949"], - "appPort": [ "4949:4949" ], + "appPort": [ "4848:4848" ], // Uncomment the next line to run commands after the container is created. // "postCreateCommand": "cat /etc/os-release", @@ -25,7 +25,6 @@ // "remoteUser": "devcontainer" "mounts": [ - //"source=${localEnv:HOME}${localEnv:USERPROFILE}/production/,target=/conf,type=bind,consistency=cached" "source=${localEnv:HOME}${localEnv:USERPROFILE}/appdir_test/,target=/conf,type=bind,consistency=cached" ], diff --git a/.devcontainer/dev/Dockerfile b/.devcontainer/dev/Dockerfile new file mode 100644 index 000000000..9abc32d25 --- /dev/null +++ b/.devcontainer/dev/Dockerfile @@ -0,0 +1,20 @@ +ARG PYTHON_RELEASE=3.12 +ARG BASE_IMAGE=mcr.microsoft.com/devcontainers/python:${PYTHON_RELEASE} +# Runtime image +FROM ${BASE_IMAGE} + +# Copy Repo across +COPY . /usr/src/appdaemon/ + +# Install AD Dependencies +RUN pip install -r /usr/src/appdaemon/requirements.txt + +# Add dev dependencies +RUN pip install -r /usr/src/appdaemon/dev-requirements.txt + +# Add doc dependencies +RUN pip install -r /usr/src/appdaemon/doc-requirements.txt + +# Install AppDaemon itself to keep VSCODE happy + +RUN pip install /usr/src/appdaemon diff --git a/.devcontainer/dev/devcontainer.json b/.devcontainer/dev/devcontainer.json new file mode 100644 index 000000000..c17943096 --- /dev/null +++ b/.devcontainer/dev/devcontainer.json @@ -0,0 +1,56 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile +{ + "name": "appdaemon-dev", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "../..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "Dockerfile", + "args": { + "PYTHON_RELEASE": "3.12" // This overrides the default of 3.12 + } + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + //"forwardPorts": ["4949:4949"], + "appPort": [ "4949:4949" ], + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "devcontainer" + + "mounts": [ + "source=${localEnv:HOME}${localEnv:USERPROFILE}/production/,target=/conf,type=bind,consistency=cached" + ], + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "njpwerner.autodocstring", + //"ms-python.black-formatter", + //"ms-python.isort", + "shd101wyy.markdown-preview-enhanced", + //"ms-python.pylint", + "DavidAnson.vscode-markdownlint", + "ms-python.debugpy", + "njqdev.vscode-python-typehint", + "charliermarsh.ruff", + "ms-python.vscode-pylance", + "lkytal.quicktask", + "ms-azuretools.vscode-docker", + "github.vscode-github-actions", + "eamodio.gitlens", + "Gruntfuggly.todo-tree", + "tamasfe.even-better-toml" + ] + + } + } +}