Skip to content

Commit d52ad4f

Browse files
author
nick
committed
misc: import docker improvements from 7.39.1.dev2
- Legacy-Id: 19629
1 parent dd3447a commit d52ad4f

32 files changed

+931
-782
lines changed

.devcontainer/devcontainer.json

Lines changed: 72 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/python-3
33
{
4-
"name": "IETF Datatracker",
5-
"dockerComposeFile": "docker-compose.yml",
4+
"name": "IETF Datatracker",
5+
"dockerComposeFile": ["../docker/docker-compose.yml", "docker-compose.extend.yml"],
66
"service": "app",
7-
"workspaceFolder": "/usr/local/share/datatracker",
7+
"workspaceFolder": "/root/src",
88
"shutdownAction": "stopCompose",
99
"postCreateCommand": "/docker-init.sh",
10-
11-
// Set *default* container specific settings.json values on container create.
12-
"settings": {
10+
"containerEnv": {
11+
"EDITOR_VSCODE": "true"
12+
},
13+
14+
// Set *default* container specific settings.json values on container create.
15+
"settings": {
1316
"terminal.integrated.defaultProfile.linux": "zsh",
14-
"python.pythonPath": "/usr/local/bin/python",
15-
"python.languageServer": "Pylance",
16-
"python.linting.enabled": true,
17-
"python.linting.pylintEnabled": true,
18-
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
19-
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
20-
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
21-
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
22-
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
23-
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
24-
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
25-
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
26-
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
17+
"python.pythonPath": "/usr/local/bin/python",
18+
"python.languageServer": "Pylance",
19+
"python.linting.enabled": true,
20+
"python.linting.pylintEnabled": true,
21+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
22+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
23+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
24+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
25+
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
26+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
27+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
28+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
29+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
2730
"python.testing.pytestArgs": [
2831
"ietf"
2932
],
@@ -35,27 +38,56 @@
3538
"./ietf",
3639
"-p",
3740
"test*.py"
41+
],
42+
"sqltools.connections": [
43+
// Default connection to dev DB container
44+
{
45+
"name": "Local Dev",
46+
"server": "db",
47+
"port": 3306,
48+
"database": "ietf_utf8",
49+
"username": "django",
50+
"password": "RkTkDPFnKpko",
51+
"driver": "MySQL",
52+
"askForPassword": false,
53+
"connectionTimeout": 60
54+
}
3855
]
3956
// "python.envFile": "${workspaceFolder}/.devcontainer/dev.env"
40-
},
41-
42-
// Add the IDs of extensions you want installed when the container is created.
43-
"extensions": [
44-
"ms-python.python",
45-
"ms-python.vscode-pylance",
46-
"ms-azuretools.vscode-docker",
47-
"editorconfig.editorconfig",
48-
"redhat.vscode-yaml",
49-
"visualstudioexptteam.vscodeintellicode",
50-
"batisteo.vscode-django",
51-
],
52-
53-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
54-
"forwardPorts": [8000, 3306]
55-
56-
// Use 'postCreateCommand' to run commands after the container is created.
57-
// "postCreateCommand": "sh /docker-init.sh",
58-
59-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
60-
// "remoteUser": "django"
57+
},
58+
59+
// Add the IDs of extensions you want installed when the container is created.
60+
"extensions": [
61+
"ms-python.python",
62+
"ms-python.vscode-pylance",
63+
"ms-azuretools.vscode-docker",
64+
"editorconfig.editorconfig",
65+
"redhat.vscode-yaml",
66+
"visualstudioexptteam.vscodeintellicode",
67+
"batisteo.vscode-django",
68+
"mutantdino.resourcemonitor",
69+
"spmeesseman.vscode-taskexplorer",
70+
"mtxr.sqltools",
71+
"mtxr.sqltools-driver-mysql"
72+
],
73+
74+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
75+
"forwardPorts": [8000, 3306],
76+
77+
"portsAttributes": {
78+
"8000": {
79+
"label": "Datatracker",
80+
"onAutoForward": "notify"
81+
},
82+
"3306": {
83+
"label": "MariaDB",
84+
"onAutoForward": "silent"
85+
}
86+
}
87+
88+
// Use 'postCreateCommand' to run commands after the container is created.
89+
// "postCreateCommand": "sh /docker-init.sh",
90+
91+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
92+
// "remoteUser": "django"
6193
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.8'
2+
3+
services:
4+
app:
5+
environment:
6+
EDITOR_VSCODE: 1
7+
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
8+
network_mode: service:db

.devcontainer/init.sh

Lines changed: 0 additions & 164 deletions
This file was deleted.

.devcontainer/settings_local.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)