Skip to content

Commit

Permalink
add devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-B98 committed Jan 7, 2025
1 parent 9754f87 commit 6c337b7
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mcr.microsoft.com/devcontainers/python:3.13

ENV PYTHONUNBUFFERED 1

# Install Python Deps
RUN pip install --upgrade pip pre-commit poetry
47 changes: 47 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "pyAKI",
"dockerComposeFile": "docker-compose.yml",
"service": "pyaki",
"workspaceFolder": "/workspaces",
"remoteUser": "vscode",
"postCreateCommand": "bash .devcontainer/scripts/post-create.sh",
"postStartCommand": "bash .devcontainer/scripts/post-start.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.mypy-type-checker",
"tamasfe.even-better-toml",
"charliermarsh.ruff",
"ryanluker.vscode-coverage-gutters",
"GitHub.copilot",
"GitHub.copilot-chat",
"ms-vsliveshare.vsliveshare",
"GitHub.vscode-pull-request-github",
"github.vscode-github-actions",
"ms-toolsai.jupyter"
],
"settings": {
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"files.eol": "\n"
},
"mypy-type-checker.importStrategy": "fromEnvironment",
"mypy-type-checker.args": [
"--config-file=${workspaceFolder}/pyproject.toml"
],
"python.analysis.typeCheckingMode": "basic",
"coverage-gutters.coverageBaseDir": "/workspaces/pyAKI",
"coverage-gutters.coverageFileNames": [
"coverage.xml"
]
}
}
},
"forwardPorts": [],
"initializeCommand": "bash .devcontainer/scripts/initialize.sh"
}
18 changes: 18 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.8'

services:
pyaki:
container_name: pyaki

init: true
build:
context: ..
dockerfile: .devcontainer/Dockerfile
environment:
- no_proxy="127.0.0.1,localhost"
- NO_PROXY="127.0.0.1,localhost"
volumes:
- ..:/workspaces:cached
- type: bind
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
1 change: 1 addition & 0 deletions .devcontainer/scripts/initialize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker pull mcr.microsoft.com/devcontainers/python:3.13
5 changes: 5 additions & 0 deletions .devcontainer/scripts/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Add bash-completion's
echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc

# install deps
pre-commit install
1 change: 1 addition & 0 deletions .devcontainer/scripts/post-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poetry install --with dev

0 comments on commit 6c337b7

Please sign in to comment.