Skip to content

Commit f4b807e

Browse files
chore: Add devcontainer. file
1 parent 009412f commit f4b807e

2 files changed

Lines changed: 144 additions & 0 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"name": "Codespace Python",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"USER_UID": "1000",
7+
"USERNAME": "codespace",
8+
"VARIANT": "latest"
9+
// "VARIANT": "stable-slim"
10+
}
11+
},
12+
13+
// Configure tool-specific properties.
14+
"customizations": {
15+
// Configure properties specific to VS Code.
16+
"vscode": {
17+
"settings": {
18+
"[python]": {
19+
"editor.wordBasedSuggestions": false,
20+
"editor.defaultFormatter": "ms-python.black-formatter",
21+
"editor.formatOnSave": true,
22+
"editor.codeActionsOnSave": {
23+
"source.organizeImports": true
24+
}
25+
},
26+
"isort.args": ["--profile", "black"],
27+
"python.defaultInterpreterPath": "python",
28+
"python.linting.enabled": true,
29+
"python.linting.pylintEnabled": true,
30+
"python.formatting.autopep8Path": "/usr/local/pipx/bin/autopep8",
31+
// "python.formatting.blackPath": "/usr/local/pipx/bin/black",
32+
"python.formatting.yapfPath": "/usr/local/pipx/bin/yapf",
33+
"python.formatting.provider": "none",
34+
"python.linting.banditPath": "/usr/local/pipx/bin/bandit",
35+
"python.linting.flake8Path": "/usr/local/pipx/bin/flake8",
36+
"python.linting.mypyPath": "/usr/local/pipx/bin/mypy",
37+
"python.linting.pycodestylePath": "/usr/local/pipx/bin/pycodestyle",
38+
"python.linting.pydocstylePath": "/usr/local/pipx/bin/pydocstyle",
39+
"python.linting.pylintPath": "/usr/local/pipx/bin/pylint"
40+
},
41+
"extensions": [
42+
"ms-python.black-formatter",
43+
"ms-python.isort",
44+
"ms-python.python"
45+
]
46+
// "devPort": {}
47+
}
48+
},
49+
50+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
51+
// "forwardPorts": [],
52+
53+
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
54+
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
55+
56+
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
57+
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
58+
59+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
60+
"remoteUser": "codespace",
61+
62+
// "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z",
63+
// "workspaceFolder": "/workspace",
64+
65+
"runArgs": [
66+
"--cap-add=SYS_PTRACE",
67+
"--env-file=.devcontainer/devcontainer.env",
68+
"--init",
69+
"--privileged",
70+
"--security-opt=seccomp=unconfined"
71+
// "--name=codespace-default",
72+
// "--userns=keep-id",
73+
],
74+
"containerUser": "codespace",
75+
"postCreateCommand": "bash test/test.sh"
76+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"name": "Codespace Python",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"USER_UID": "1000",
7+
"USERNAME": "vscode",
8+
"VARIANT": "latest"
9+
// "VARIANT": "stable-slim"
10+
}
11+
},
12+
13+
// Configure tool-specific properties.
14+
"customizations": {
15+
// Configure properties specific to VS Code.
16+
"vscode": {
17+
"settings": {
18+
"[python]": {
19+
"editor.wordBasedSuggestions": false,
20+
"editor.defaultFormatter": "ms-python.black-formatter",
21+
"editor.formatOnSave": true,
22+
"editor.codeActionsOnSave": {
23+
"source.organizeImports": true
24+
}
25+
},
26+
"isort.args": ["--profile", "black"],
27+
"python.defaultInterpreterPath": "python",
28+
"python.linting.enabled": true,
29+
"python.linting.pylintEnabled": true,
30+
"python.formatting.autopep8Path": "/usr/local/pipx/bin/autopep8",
31+
// "python.formatting.blackPath": "/usr/local/pipx/bin/black",
32+
"python.formatting.yapfPath": "/usr/local/pipx/bin/yapf",
33+
"python.formatting.provider": "none",
34+
"python.linting.banditPath": "/usr/local/pipx/bin/bandit",
35+
"python.linting.flake8Path": "/usr/local/pipx/bin/flake8",
36+
"python.linting.mypyPath": "/usr/local/pipx/bin/mypy",
37+
"python.linting.pycodestylePath": "/usr/local/pipx/bin/pycodestyle",
38+
"python.linting.pydocstylePath": "/usr/local/pipx/bin/pydocstyle",
39+
"python.linting.pylintPath": "/usr/local/pipx/bin/pylint"
40+
},
41+
"extensions": [
42+
"ms-python.black-formatter",
43+
"ms-python.isort",
44+
"ms-python.python"
45+
]
46+
// "devPort": {}
47+
}
48+
},
49+
50+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
51+
// "forwardPorts": [],
52+
53+
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
54+
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
55+
56+
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
57+
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
58+
59+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
60+
"remoteUser": "vscode",
61+
62+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z",
63+
"workspaceFolder": "/workspace",
64+
65+
"runArgs": ["--userns=keep-id", "--name=codespace-python"],
66+
"containerUser": "vscode",
67+
"postCreateCommand": "bash test/test.sh"
68+
}

0 commit comments

Comments
 (0)