Skip to content

Commit

Permalink
add devcontainer setup, adjust docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lociii committed Feb 20, 2025
1 parent 7290030 commit e1ebde2
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
app:
entrypoint: ""
command: sleep infinity
build:
context: .
189 changes: 189 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
{
// name of the devcontainer
"name": "django_scrubber",
// define the docker compose file to use for the devcontainer
"dockerComposeFile": [
"../compose.yaml",
"./compose.yaml"
],
// define which services from the compose file to start and stop
"runServices": [
"app"
],
// define the docker-compose service to use for the dev container
"service": "app",
// define the workspace folder our app is located in
"workspaceFolder": "/app",
// set the remote user to connect as
"remoteUser": "app",
// features to be installed in the dev container
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/git:1": {}
},
// configure vscode
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {
// terminal settings
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
},
"terminal.integrated.defaultProfile.linux": "bash",
// language specific editor settings
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"[markdown]": {
"files.trimTrailingWhitespace": false
},
// allow tasks to run on editor startup
"task.allowAutomaticTasks": "on",
// python environment
"python.defaultInterpreterPath": "/home/app/venv/bin/python",
"python.analysis.extraPaths": [
"/home/app/venv/lib/python3.12/site-packages/"
],
"python.analysis.useImportHeuristic": true,
"python.analysis.autoSearchPaths": true,
"python.analysis.autoImportCompletions": true,
"python.analysis.indexing": true,
"python.analysis.packageIndexDepths": [
{
"name": "",
"depth": 10,
"includeAllSymbols": true
}
],
// don't activate the virtual environment every time as we're using the env binary
"python.terminal.activateEnvironment": false,
"python.terminal.activateEnvInCurrentTerminal": true,
// used for autocomplete etc
"python.languageServer": "Pylance",
// editor settings
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "always"
},
"editor.rulers": [
88,
120
],
// shows the nested current scopes during the scroll at the top of the editor
"editor.stickyScroll.enabled": true,
// file formatting options
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.associations": {
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
},
// files to exclude from search results
"search.exclude": {
"**/__pycache__": true,
"**/.bash_aliases": true,
"**/.git": true,
"**/.ipython": true,
"**/.mypy_cache": true,
"**/logs": true,
"**/node_modules": true,
"**/tmp": true
},
// files to exclude from all checks
"files.exclude": {
"**/*.pyc": true,
"**/.git": false,
"**/migrations/*": false
},
// gitlens settings
"gitlens.codeLens.enabled": false,
"gitlens.advanced.blame.customArguments": [
"--ignore-revs-file",
".git-blame-ignore-revs"
],
// copilot settings
"github.copilot.editor.enableAutoCompletions": true,
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false,
"scminput": false
}
},
// list all extensions that should be installed when the container is created
"extensions": [
// ---------------------------------------
// CODING SUPPORT
// ---------------------------------------
// Visual Studio IntelliCode - AI-assisted development
// https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode
"visualstudioexptteam.vscodeintellicode",
// ---------------------------------------
// PYTHON
// ---------------------------------------
// Python extension for Visual Studio Code
// https://marketplace.visualstudio.com/items?itemName=ms-python.python
"ms-python.python",
// Pylance - A performant, feature-rich language server for Python in VS Code
// https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance
"ms-python.vscode-pylance",
// Python docstring generator
// https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring
"njpwerner.autodocstring",
// Proper indentation for Python
// https://marketplace.visualstudio.com/items?itemName=KevinRose.vsc-python-indent
"KevinRose.vsc-python-indent",
// Visually highlight indentation depth
// https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow
"oderwat.indent-rainbow",
// Code comment highlights
// https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
"aaron-bond.better-comments",
// Linting with ruff
// https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff
// updates to the ruff vscode plugin must be in sync with github actions
"[email protected]",
// Linting with mypy
// https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker
"ms-python.mypy-type-checker",
// ---------------------------------------
// GIT
// ---------------------------------------
// View git log, file history, compare branches or commits
// https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
"donjayamanne.githistory",
// Supercharge the Git capabilities built into Visual Studio Code
// https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
"eamodio.gitlens",
// GitLab Workflow
// https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow
"GitLab.gitlab-workflow",
// create / apply git patches
// https://marketplace.visualstudio.com/items?itemName=paragdiwan.gitpatch
"paragdiwan.gitpatch",
// ---------------------------------------
// FILE TYPE SUPPORT
// ---------------------------------------
// Support for dotenv file syntax
// https://marketplace.visualstudio.com/items?itemName=mikestead.dotenv
"mikestead.dotenv",
// Syntax highlighting for .po files
// https://marketplace.visualstudio.com/items?itemName=mrorz.language-gettext
"mrorz.language-gettext",
// Duplicate translation error marking for .po files
// https://marketplace.visualstudio.com/items?itemName=ovcharik.gettext-duplicate-error
"ovcharik.gettext-duplicate-error",
// YAML language support
// https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml
"redhat.vscode-yaml",
// TOML language support
// https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml
"tamasfe.even-better-toml"
]
}
}
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bookworm
FROM python:3.12-slim-bookworm

ENV PYTHONUNBUFFERED 1
ENV LC_ALL=C.UTF-8
Expand Down
File renamed without changes.

0 comments on commit e1ebde2

Please sign in to comment.