Skip to content

Commit 30e705b

Browse files
committed
Add devcontainer setup
1 parent 65ae17f commit 30e705b

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM ubuntu:latest
2+
3+
ARG USERNAME=user
4+
ARG USER_UID=1000
5+
ARG USER_GID=$USER_UID
6+
7+
RUN apt-get update
8+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
9+
curl \
10+
flake8 \
11+
gh \
12+
git \
13+
gnupg2 \
14+
jq \
15+
libcap-dev \
16+
libssl-dev \
17+
pylint \
18+
python3 \
19+
python3-dev \
20+
python3-flake8 \
21+
python3-pip \
22+
python3-pycodestyle \
23+
sudo \
24+
zsh
25+
26+
RUN groupadd --gid $USER_GID $USERNAME \
27+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
28+
&& chsh -s /usr/bin/zsh user \
29+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
30+
&& chmod 0440 /etc/sudoers.d/$USERNAME
31+
32+
USER $USERNAME
33+
WORKDIR /home/$USERNAME

.devcontainer/devcontainer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "Codespaces Python3",
3+
"extensions": [
4+
"cschleiden.vscode-github-actions",
5+
"eamodio.gitlens",
6+
"github.vscode-pull-request-github",
7+
"ms-azuretools.vscode-docker",
8+
"ms-python.flake8",
9+
"ms-python.pylint",
10+
"ms-python.python",
11+
"ms-vsliveshare.vsliveshare",
12+
"nwgh.bandit",
13+
"the-compiler.python-tox",
14+
"vscode-icons-team.vscode-icons",
15+
"visualstudioexptteam.vscodeintellicode"
16+
],
17+
"dockerFile": "Dockerfile",
18+
"onCreateCommand": "pip3 install -r .devcontainer/requirements.txt",
19+
"postCreateCommand": "pip3 install -r requirements.txt",
20+
"settings": {
21+
"flake8.args": ["--config=setup.cfg"],
22+
"pylint.args": ["--rcfile=setup.cfg"],
23+
"terminal.integrated.shell.linux": "/usr/bin/zsh",
24+
"terminal.integrated.defaultProfile.linux": "zsh",
25+
"terminal.integrated.fontFamily": "'SourceCodePro+Powerline+Awesome Regular'",
26+
"terminal.integrated.fontSize": 14,
27+
"files.exclude": {
28+
"**/CODE_OF_CONDUCT.md": true,
29+
"**/LICENSE": true
30+
}
31+
}
32+
}

.devcontainer/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tox
2+
virtualenv

0 commit comments

Comments
 (0)