Skip to content

Commit

Permalink
feat: Single docker configuration for VS Code and generic dev
Browse files Browse the repository at this point in the history
 - Legacy-Id: 19604
  • Loading branch information
nick committed Nov 10, 2021
1 parent 4c1cfea commit 40f69e7
Show file tree
Hide file tree
Showing 26 changed files with 1,389 additions and 360 deletions.
114 changes: 73 additions & 41 deletions .devcontainer/devcontainer.json
@@ -1,29 +1,32 @@
// 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.202.5/containers/python-3
{
"name": "IETF Datatracker",
"dockerComposeFile": "docker-compose.yml",
"name": "IETF Datatracker",
"dockerComposeFile": ["../docker/docker-compose.yml", "docker-compose.extend.yml"],
"service": "app",
"workspaceFolder": "/usr/local/share/datatracker",
"workspaceFolder": "/root/src",
"shutdownAction": "stopCompose",
"postCreateCommand": "/docker-init.sh",

// Set *default* container specific settings.json values on container create.
"settings": {
"postCreateCommand": ".devcontainer/init.sh",
"containerEnv": {
"EDITOR_VSCODE": "true"
},

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"python.testing.pytestArgs": [
"ietf"
],
Expand All @@ -35,27 +38,56 @@
"./ietf",
"-p",
"test*.py"
],
"sqltools.connections": [
// Default connection to dev DB container
{
"name": "Local Dev",
"server": "db",
"port": 3306,
"database": "ietf_utf8",
"username": "django",
"password": "RkTkDPFnKpko",
"driver": "MySQL",
"askForPassword": false,
"connectionTimeout": 60
}
]
// "python.envFile": "${workspaceFolder}/.devcontainer/dev.env"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"redhat.vscode-yaml",
"visualstudioexptteam.vscodeintellicode",
"batisteo.vscode-django",
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000, 3306]

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sh /docker-init.sh",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "django"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"redhat.vscode-yaml",
"visualstudioexptteam.vscodeintellicode",
"batisteo.vscode-django",
"mutantdino.resourcemonitor",
"spmeesseman.vscode-taskexplorer",
"mtxr.sqltools",
"mtxr.sqltools-driver-mysql"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000, 3306],

"portsAttributes": {
"8000": {
"label": "Datatracker",
"onAutoForward": "notify"
},
"3306": {
"label": "MariaDB",
"onAutoForward": "silent"
}
}

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sh /docker-init.sh",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "django"
}
6 changes: 6 additions & 0 deletions .devcontainer/docker-compose.extend.yml
@@ -0,0 +1,6 @@
version: '3.8'

services:
app:
environment:
EDITOR_VSCODE: 1
164 changes: 0 additions & 164 deletions .devcontainer/init.sh

This file was deleted.

45 changes: 45 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,45 @@
{
"taskExplorer.exclude": [
"**/.vscode-test/**",
"**/bin/**",
"**/build/**",
"**/CompiledOutput/**",
"**/dist/**",
"**/doc/**",
"**/ext/**",
"**/out/**",
"**/output/**",
"**/packages/**",
"**/release/**",
"**/releases/**",
"**/samples/**",
"**/sdks/**",
"**/static/**",
"**/target/**",
"**/test/**",
"**/third_party/**",
"**/vendor/**",
"**/work/**",
"/root/src/bootstrap/nuget/MyGet.ps1"
],
"taskExplorer.enableAnt": false,
"taskExplorer.enableAppPublisher": false,
"taskExplorer.enablePipenv": false,
"taskExplorer.enableBash": false,
"taskExplorer.enableBatch": false,
"taskExplorer.enableGradle": false,
"taskExplorer.enableGrunt": false,
"taskExplorer.enableGulp": false,
"taskExplorer.enablePerl": false,
"taskExplorer.enableMake": false,
"taskExplorer.enableMaven": false,
"taskExplorer.enableNsis": false,
"taskExplorer.enableNpm": false,
"taskExplorer.enablePowershell": false,
"taskExplorer.enablePython": false,
"taskExplorer.enableRuby": false,
"taskExplorer.enableTsc": false,
"taskExplorer.enableWorkspace": true,
"taskExplorer.enableExplorerView": false,
"taskExplorer.enableSideBar": true
}

0 comments on commit 40f69e7

Please sign in to comment.