Skip to content

Commit

Permalink
Add dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
asbjornb committed May 24, 2022
1 parent 1ebda76 commit 29c1f98
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.10.4

COPY ./.devcontainer/requirements.txt /

# Install Python dependencies
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt

#create a non root user to access the container
RUN adduser vscode
40 changes: 40 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 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.234.0/containers/python-3
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
},

// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"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"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],

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

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
17 changes: 17 additions & 0 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
astroid==2.11.5
black==22.3.0
click==8.1.3
dill==0.3.5.1
isort==5.10.1
Jinja2==3.1.2 # Actual requirement
lazy-object-proxy==1.7.1
markdown2==2.4.3 # Actual requirement
MarkupSafe==2.1.1
mccabe==0.7.0
mypy-extensions==0.4.3
pathspec==0.9.0
platformdirs==2.5.2
pycodestyle==2.8.0
pylint==2.13.9
tomli==2.0.1
wrapt==1.14.1

0 comments on commit 29c1f98

Please sign in to comment.