From c6db51a5ccc0cc27b1f1cc6f1e661b04a35aa1b6 Mon Sep 17 00:00:00 2001 From: Anson Date: Sun, 15 Aug 2021 17:48:50 -0700 Subject: [PATCH] embracing the devcontainers --- .devcontainer/devcontainer.json | 25 +++++++++++++++++++++++++ .gitignore | 4 +--- .vscode/settings.json | 20 ++++++++++++++++++++ DockerDev | 7 +++++++ 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/settings.json create mode 100644 DockerDev diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..1587f43 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.0/containers/docker-existing-dockerfile +{ + "name": "DockerDev", + // 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": "../DockerDev", + // Set *default* container specific settings.json values on container create. + "settings": {}, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.python" + ] + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Uncomment the next line to run commands after the container is created - for example installing curl. + // "postCreateCommand": "apt-get update && apt-get install -y curl", + // Uncomment when using a ptrace-based debugger like C++, Go, and Rust + // "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. + // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], + // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. + // "remoteUser": "vscode" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5e5820c..ed8ebf5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -.vscode/settings.json -__pycache__ -.devcontainer \ No newline at end of file +__pycache__ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..90f899a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,20 @@ +{ + "workbench.iconTheme": "vscode-icons", + "editor.suggestSelection": "first", + "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", + "python.languageServer": "Pylance", + "git.autofetch": true, + "editor.formatOnSave": true, + "files.associations": { + "DockerDev": "dockerfile", + }, + "workbench.colorTheme": "One Dark Pro", + "explorer.confirmDelete": false, + "editor.fontFamily": "JetBrains Mono", + "editor.letterSpacing": 1.2, + "editor.fontLigatures": true, + "editor.wordWrap": "on", + "python.formatting.provider": "black", + "python.showStartPage": false, + "editor.fontSize": 13, +} \ No newline at end of file diff --git a/DockerDev b/DockerDev new file mode 100644 index 0000000..ab818c3 --- /dev/null +++ b/DockerDev @@ -0,0 +1,7 @@ +FROM python:3.9-buster + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir black +COPY . . +