Skip to content

Commit

Permalink
Add initial dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcen committed Mar 1, 2024
1 parent 50a9499 commit 92df127
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bullseye

RUN apt-get update && \
apt-get install -y \
binutils \
libproj-dev \
gdal-bin \
libsqlite3-mod-spatialite \
# Database client for using './manage.py dbshell' etc
sqlite3 \
spatialite-bin \
postgresql-client \
&& \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
108 changes: 108 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
//"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
"build": { "dockerfile": "Dockerfile" },
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"azureDnsAutoDetection": true,
"installDockerBuildx": true,
"installDockerComposeSwitch": true,
"version": "latest",
"dockerDashComposeVersion": "latest"
},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": true,
"installDockerBuildx": true,
"version": "latest",
"dockerDashComposeVersion": "v2"
},
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/markdownlint-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/mypy:2": {
"version": "latest"
},
//"ghcr.io/devcontainers-contrib/features/neovim-apt-get:1": {},
//"ghcr.io/devcontainers-contrib/features/pre-commit:2": {
// "version": "latest"
//},
"ghcr.io/devcontainers-contrib/features/ruff:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/tailscale:1": {},
//"ghcr.io/devcontainers-contrib/features/tmux-apt-get:1": {},
//"ghcr.io/devcontainers-contrib/features/vscode-cli:1": {
// "version": "latest"
//},
//"ghcr.io/devcontainers-contrib/features/vscode-server:1": {
// "version": "latest"
//},
"ghcr.io/devcontainers-contrib/features/wget-apt-get:1": {},
//"ghcr.io/devcontainers-contrib/features/wireguard-apt-get:1": {},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {
"jqVersion": "latest",
"yqVersion": "none",
"gojqVersion": "none",
"xqVersion": "none",
"jaqVersion": "none"
},
"ghcr.io/eitsupi/devcontainer-features/mdbook:1": {
"version": "latest"
},
"ghcr.io/dhoeric/features/hadolint:1": {},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {},
"ghcr.io/guiyomh/features/vim:0": {},
"ghcr.io/lukewiwa/features/shellcheck:0": {
"version": "stable"
},
"ghcr.io/jsburckhardt/devcontainer-features/gitleaks:1": {},
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {},
//"ghcr.io/frntn/devcontainers-features/gitleaks:1": {
// "version": "latest"
//},
"ghcr.io/marcozac/devcontainer-features/shellcheck:1": {
"version": "latest"
},
"ghcr.io/schlich/devcontainer-features/rye:1": {
"uv": true
},
"ghcr.io/hspaans/devcontainer-features/pytest:1": {
"version": "latest",
"plugins": "pytest-testinfra"
}
},

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

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

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"monosans.djlint",
"redhat.vscode-yaml",
"ms-python.python",
"ms-python.mypy-type-checker",
"elagil.pre-commit-helper",
"alexcvzz.vscode-sqlite",
"eamodio.gitlens",
"tamasfe.even-better-toml"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
Expand All @@ -11,3 +12,7 @@ updates:
directory: "django/"
schedule:
interval: "weekly"
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ repos:
- id: check-executables-have-shebangs
# Attempts to load all json files to verify syntax.
- id: check-json
exclude: .devcontainer/devcontainer.json
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Checks that scripts with shebangs are executable.
Expand Down

0 comments on commit 92df127

Please sign in to comment.