|
| 1 | +// For format details, see https://aka.ms/devcontainer.json. For config options, see the |
| 2 | +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose |
| 3 | +{ |
| 4 | + "name": "bats-ai", |
| 5 | + "dockerComposeFile": [ |
| 6 | + "../docker-compose.yml", |
| 7 | + "../docker-compose.override.yml", |
| 8 | + "./docker-compose.devcontainer.yml" |
| 9 | + ], |
| 10 | + "service": "django", |
| 11 | + "overrideCommand": true, |
| 12 | + // The "vscode" user and remoteUser are set by the base image label (devcontainers/base). |
| 13 | + "workspaceFolder": "/home/vscode/bats-ai", |
| 14 | + "features": { |
| 15 | + "ghcr.io/devcontainers/features/git-lfs:1": {}, |
| 16 | + "ghcr.io/devcontainers/features/node:1": {}, |
| 17 | + "ghcr.io/rails/devcontainer/features/postgres-client:1": { |
| 18 | + "version": 18 |
| 19 | + }, |
| 20 | + "ghcr.io/devcontainers/features/terraform:1": {}, |
| 21 | + "ghcr.io/devcontainers/features/aws-cli:1": {}, |
| 22 | + "ghcr.io/devcontainers/features/github-cli:1": {}, |
| 23 | + "ghcr.io/devcontainers-extra/features/heroku-cli:1": {} |
| 24 | + }, |
| 25 | + "customizations": { |
| 26 | + "vscode": { |
| 27 | + "extensions": [ |
| 28 | + // Python |
| 29 | + "ms-python.python", |
| 30 | + "ms-python.vscode-pylance", |
| 31 | + "ms-python.debugpy", |
| 32 | + "ms-python.mypy-type-checker", |
| 33 | + "charliermarsh.ruff", |
| 34 | + // Django |
| 35 | + "batisteo.vscode-django", |
| 36 | + "augustocdias.tasks-shell-input", |
| 37 | + // Other file formats |
| 38 | + "editorconfig.editorconfig", |
| 39 | + "mikestead.dotenv", |
| 40 | + "tamasfe.even-better-toml", |
| 41 | + "timonwong.shellcheck", |
| 42 | + // Infrastructure |
| 43 | + "ms-azuretools.vscode-containers", |
| 44 | + "hashicorp.terraform", |
| 45 | + "github.vscode-github-actions", |
| 46 | + // Remove AWS extension, as only the CLI is wanted; see: https://github.com/devcontainers/features/issues/1228 |
| 47 | + "-AmazonWebServices.aws-toolkit-vscode" |
| 48 | + ], |
| 49 | + "settings": { |
| 50 | + "containers.containerClient": "com.microsoft.visualstudio.containers.docker", |
| 51 | + // Container-specific Python paths |
| 52 | + "python.defaultInterpreterPath": "/home/vscode/venv/bin/python", |
| 53 | + // Ensure that `envFile` from any user settings is ignored; Docker Compose provides it. |
| 54 | + "python.envFile": "", |
| 55 | + // Reduce file watcher overhead for generated/cache directories. |
| 56 | + "files.watcherExclude": { |
| 57 | + "**/__pycache__/**": true, |
| 58 | + "**/.pytest_cache/**": true, |
| 59 | + "**/node_modules/**": true |
| 60 | + } |
| 61 | + } |
| 62 | + } |
| 63 | + }, |
| 64 | + // Prevent a prompt every time the debugger opens a port or Django auto-restarts. |
| 65 | + "otherPortsAttributes": { |
| 66 | + "onAutoForward": "silent" |
| 67 | + }, |
| 68 | + "portsAttributes": { |
| 69 | + "8000": { |
| 70 | + "label": "Django", |
| 71 | + // Show a dialog if the port isn't free. |
| 72 | + "requireLocalPort": true, |
| 73 | + "onAutoForward": "silent" |
| 74 | + }, |
| 75 | + "8080": { |
| 76 | + "label": "Vite", |
| 77 | + "requireLocalPort": true, |
| 78 | + "onAutoForward": "silent" |
| 79 | + } |
| 80 | + }, |
| 81 | + // Install a global Python and create a venv before VSCode extensions start, |
| 82 | + // to prevent prompts and ensure test discovery works on first load. |
| 83 | + "onCreateCommand": { |
| 84 | + "python": ["uv", "python", "install", "--default"], |
| 85 | + "venv": ["uv", "sync", "--all-extras", "--all-groups"], |
| 86 | + "npm": ["npm", "--prefix", "client", "install"] |
| 87 | + }, |
| 88 | + // Ensure it is re-synced on restarts. |
| 89 | + "updateContentCommand": { |
| 90 | + "venv": ["uv", "sync", "--all-extras", "--all-groups"], |
| 91 | + "npm": ["npm", "--prefix", "client", "install"] |
| 92 | + } |
| 93 | +} |
0 commit comments