container-superposition 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/tool/cli/args.d.ts.map +1 -1
- package/dist/tool/cli/args.js +1 -1
- package/dist/tool/cli/args.js.map +1 -1
- package/dist/tool/commands/adopt.d.ts.map +1 -1
- package/dist/tool/commands/adopt.js +15 -21
- package/dist/tool/commands/adopt.js.map +1 -1
- package/dist/tool/commands/doctor.d.ts +1 -0
- package/dist/tool/commands/doctor.d.ts.map +1 -1
- package/dist/tool/commands/doctor.js +1370 -73
- package/dist/tool/commands/doctor.js.map +1 -1
- package/dist/tool/questionnaire/composer.d.ts +3 -1
- package/dist/tool/questionnaire/composer.d.ts.map +1 -1
- package/dist/tool/questionnaire/composer.js +273 -20
- package/dist/tool/questionnaire/composer.js.map +1 -1
- package/dist/tool/questionnaire/presets.d.ts.map +1 -1
- package/dist/tool/questionnaire/presets.js +1 -0
- package/dist/tool/questionnaire/presets.js.map +1 -1
- package/dist/tool/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/tool/questionnaire/questionnaire.js +3 -1
- package/dist/tool/questionnaire/questionnaire.js.map +1 -1
- package/dist/tool/schema/project-config.d.ts.map +1 -1
- package/dist/tool/schema/project-config.js +174 -1
- package/dist/tool/schema/project-config.js.map +1 -1
- package/dist/tool/schema/types.d.ts +53 -2
- package/dist/tool/schema/types.d.ts.map +1 -1
- package/docs/README.md +1 -0
- package/docs/overlays.md +188 -147
- package/docs/specs/001-verbose-plan-graph/spec.md +5 -12
- package/docs/specs/002-superposition-config-file/spec.md +5 -12
- package/docs/specs/003-mkdocs2-overlay/spec.md +2 -9
- package/docs/specs/004-doctor-fix/spec.md +1 -8
- package/docs/specs/005-cuda-overlay/spec.md +2 -9
- package/docs/specs/006-rocm-overlay/spec.md +3 -10
- package/docs/specs/007-target-aware-generation/spec.md +4 -11
- package/docs/specs/008-project-file-canonical/spec.md +7 -8
- package/docs/specs/009-project-env/spec.md +3 -10
- package/docs/specs/010-compose-env-materialization/spec.md +3 -10
- package/docs/specs/011-overlay-parameters/spec.md +2 -9
- package/docs/specs/012-ollama-cli-overlay/spec.md +47 -0
- package/docs/specs/013-doctor-dependency-check/spec.md +250 -0
- package/docs/specs/014-doctor-compose-port-cross-validation/spec.md +276 -0
- package/docs/specs/015-doctor-env-example-drift/spec.md +248 -0
- package/docs/specs/016-doctor-reproducibility-check/spec.md +276 -0
- package/docs/specs/017-doctor-dry-run/spec.md +276 -0
- package/docs/specs/{007-init-project-file → 018-init-project-file}/spec.md +2 -9
- package/docs/specs/019-project-mounts/spec.md +176 -0
- package/docs/specs/taxonomy.md +186 -0
- package/docs/superposition-yml.md +467 -0
- package/overlays/.presets/full-observability.yml +113 -0
- package/overlays/.presets/k8s-dev.yml +174 -0
- package/overlays/.presets/local-llm.yml +105 -0
- package/overlays/.presets/vector-ai.yml +150 -0
- package/overlays/.shared/vscode/js-ts-settings.json +19 -0
- package/overlays/.shared/vscode/markdown-extensions.json +8 -0
- package/overlays/alertmanager/devcontainer.patch.json +0 -1
- package/overlays/alertmanager/docker-compose.yml +8 -0
- package/overlays/alertmanager/overlay.yml +1 -0
- package/overlays/amp/devcontainer.patch.json +4 -1
- package/overlays/ansible/README.md +163 -0
- package/overlays/ansible/devcontainer.patch.json +14 -0
- package/overlays/ansible/overlay.yml +18 -0
- package/overlays/argocd/README.md +158 -0
- package/overlays/argocd/devcontainer.patch.json +9 -0
- package/overlays/argocd/overlay.yml +17 -0
- package/overlays/argocd/setup.sh +29 -0
- package/overlays/argocd/verify.sh +14 -0
- package/overlays/bun/devcontainer.patch.json +1 -10
- package/overlays/bun/overlay.yml +8 -1
- package/overlays/claude-code/devcontainer.patch.json +6 -1
- package/overlays/codex/devcontainer.patch.json +5 -0
- package/overlays/comfyui/docker-compose.yml +1 -0
- package/overlays/comfyui/overlay.yml +4 -0
- package/overlays/commitlint/devcontainer.patch.json +1 -6
- package/overlays/docker-sock/overlay.yml +1 -0
- package/overlays/dotnet/overlay.yml +4 -1
- package/overlays/fuseki/.env.example +5 -0
- package/overlays/fuseki/README.md +173 -0
- package/overlays/fuseki/devcontainer.patch.json +18 -0
- package/overlays/fuseki/docker-compose.yml +29 -0
- package/overlays/fuseki/overlay.yml +42 -0
- package/overlays/fuseki/verify.sh +58 -0
- package/overlays/gemini-cli/devcontainer.patch.json +4 -1
- package/overlays/go/overlay.yml +6 -1
- package/overlays/grafana/devcontainer.patch.json +0 -1
- package/overlays/grafana/docker-compose.yml +8 -2
- package/overlays/grafana/overlay.yml +6 -1
- package/overlays/jaeger/.env.example +11 -0
- package/overlays/jaeger/README.md +33 -4
- package/overlays/jaeger/devcontainer.patch.json +9 -1
- package/overlays/jaeger/docker-compose.yml +17 -0
- package/overlays/jaeger/overlay.yml +1 -12
- package/overlays/java/overlay.yml +6 -1
- package/overlays/jupyter/docker-compose.yml +1 -0
- package/overlays/jupyter/overlay.yml +1 -0
- package/overlays/keycloak/devcontainer.patch.json +0 -1
- package/overlays/keycloak/docker-compose.yml +1 -0
- package/overlays/keycloak/overlay.yml +15 -0
- package/overlays/localstack/docker-compose.yml +1 -0
- package/overlays/localstack/overlay.yml +19 -1
- package/overlays/loki/devcontainer.patch.json +0 -1
- package/overlays/loki/docker-compose.yml +8 -0
- package/overlays/loki/overlay.yml +1 -0
- package/overlays/mailpit/docker-compose.yml +1 -0
- package/overlays/mailpit/overlay.yml +1 -0
- package/overlays/minio/devcontainer.patch.json +1 -1
- package/overlays/minio/docker-compose.yml +1 -0
- package/overlays/minio/overlay.yml +23 -2
- package/overlays/mkdocs/devcontainer.patch.json +1 -5
- package/overlays/mkdocs/overlay.yml +3 -1
- package/overlays/mkdocs2/devcontainer.patch.json +1 -5
- package/overlays/mkdocs2/overlay.yml +2 -0
- package/overlays/mongodb/docker-compose.yml +2 -0
- package/overlays/mongodb/overlay.yml +26 -2
- package/overlays/mysql/docker-compose.yml +2 -0
- package/overlays/mysql/overlay.yml +36 -2
- package/overlays/nats/docker-compose.yml +1 -0
- package/overlays/nats/overlay.yml +18 -2
- package/overlays/nodejs/devcontainer.patch.json +1 -12
- package/overlays/nodejs/overlay.yml +8 -1
- package/overlays/ollama/README.md +4 -3
- package/overlays/ollama/docker-compose.yml +1 -0
- package/overlays/ollama/overlay.yml +6 -1
- package/overlays/ollama/verify.sh +5 -28
- package/overlays/ollama-cli/README.md +90 -0
- package/overlays/ollama-cli/devcontainer.patch.json +3 -0
- package/overlays/ollama-cli/overlay.yml +19 -0
- package/overlays/{ollama → ollama-cli}/setup.sh +7 -10
- package/overlays/ollama-cli/verify.sh +49 -0
- package/overlays/open-webui/docker-compose.yml +1 -0
- package/overlays/open-webui/overlay.yml +8 -1
- package/overlays/opencode/devcontainer.patch.json +4 -1
- package/overlays/otel-collector/README.md +4 -0
- package/overlays/otel-collector/devcontainer.patch.json +4 -1
- package/overlays/otel-collector/docker-compose.yml +8 -4
- package/overlays/otel-collector/overlay.yml +1 -0
- package/overlays/otel-demo-nodejs/devcontainer.patch.json +0 -1
- package/overlays/otel-demo-nodejs/docker-compose.yml +1 -0
- package/overlays/otel-demo-nodejs/overlay.yml +9 -1
- package/overlays/otel-demo-python/devcontainer.patch.json +0 -1
- package/overlays/otel-demo-python/docker-compose.yml +1 -0
- package/overlays/otel-demo-python/overlay.yml +6 -1
- package/overlays/pandoc/README.md +10 -0
- package/overlays/pandoc/devcontainer.patch.json +0 -5
- package/overlays/pandoc/overlay.yml +2 -0
- package/overlays/pandoc/setup.sh +10 -0
- package/overlays/pgvector/devcontainer.patch.json +11 -5
- package/overlays/pgvector/docker-compose.yml +1 -0
- package/overlays/pgvector/overlay.yml +3 -0
- package/overlays/playwright/devcontainer.patch.json +0 -5
- package/overlays/playwright/overlay.yml +2 -1
- package/overlays/postgres/docker-compose.yml +1 -0
- package/overlays/postgres/overlay.yml +4 -1
- package/overlays/pre-commit/devcontainer.patch.json +1 -7
- package/overlays/prometheus/devcontainer.patch.json +0 -1
- package/overlays/prometheus/docker-compose.yml +8 -0
- package/overlays/prometheus/overlay.yml +1 -0
- package/overlays/promtail/devcontainer.patch.json +1 -2
- package/overlays/promtail/docker-compose.yml +8 -0
- package/overlays/promtail/overlay.yml +1 -0
- package/overlays/qdrant/docker-compose.yml +1 -0
- package/overlays/qdrant/overlay.yml +5 -1
- package/overlays/rabbitmq/docker-compose.yml +1 -0
- package/overlays/rabbitmq/overlay.yml +25 -2
- package/overlays/redis/docker-compose.yml +7 -0
- package/overlays/redis/overlay.yml +15 -1
- package/overlays/redpanda/docker-compose.yml +1 -0
- package/overlays/redpanda/overlay.yml +15 -3
- package/overlays/rocm/overlay.yml +2 -1
- package/overlays/rust/overlay.yml +3 -1
- package/overlays/sqlserver/docker-compose.yml +1 -0
- package/overlays/sqlserver/overlay.yml +17 -0
- package/overlays/task/README.md +47 -0
- package/overlays/task/devcontainer.patch.json +9 -0
- package/overlays/task/overlay.yml +16 -0
- package/overlays/task/setup.sh +29 -0
- package/overlays/task/verify.sh +14 -0
- package/overlays/tempo/devcontainer.patch.json +0 -1
- package/overlays/tempo/docker-compose.yml +8 -0
- package/overlays/tempo/overlay.yml +1 -0
- package/overlays/windsurf-cli/devcontainer.patch.json +4 -1
- package/package.json +1 -1
- package/tool/schema/config.schema.json +74 -1
- package/overlays/.shared/otel/otel-base-config.yaml +0 -30
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
# Authoring `superposition.yml`
|
|
2
|
+
|
|
3
|
+
`superposition.yml` (or `.superposition.yml`) is the **canonical input** for all
|
|
4
|
+
container-superposition generation and regeneration flows. Commit it to your repository to
|
|
5
|
+
guarantee reproducible devcontainer builds across your team and CI.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
- `init` always writes `superposition.yml` as its primary output.
|
|
10
|
+
- `regen` reads only the project file — `superposition.json` is an output-only receipt.
|
|
11
|
+
- `doctor` validates the project file against the last-generated manifest and reports drift.
|
|
12
|
+
- Repos without a project file should run `cs migrate` once to create one from their manifest.
|
|
13
|
+
|
|
14
|
+
## File discovery
|
|
15
|
+
|
|
16
|
+
The tool searches the repository root for `superposition.yml` then `.superposition.yml`. If both
|
|
17
|
+
exist, it fails with an error — keep only one.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Reference
|
|
22
|
+
|
|
23
|
+
### `stack`
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
stack: plain # or compose
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
| Value | Description |
|
|
30
|
+
| --------- | --------------------------------------------------- |
|
|
31
|
+
| `plain` | Single-image devcontainer (no Docker Compose) |
|
|
32
|
+
| `compose` | Multi-service devcontainer backed by Docker Compose |
|
|
33
|
+
|
|
34
|
+
Required. Always set this explicitly.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
### `baseImage`
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
baseImage: bookworm # default
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| Value | Image |
|
|
45
|
+
| ---------- | -------------------------------------------------- |
|
|
46
|
+
| `bookworm` | `mcr.microsoft.com/devcontainers/base:bookworm` ⭐ |
|
|
47
|
+
| `trixie` | `mcr.microsoft.com/devcontainers/base:trixie` |
|
|
48
|
+
| `alpine` | `mcr.microsoft.com/devcontainers/base:alpine` |
|
|
49
|
+
| `ubuntu` | `mcr.microsoft.com/devcontainers/base:ubuntu` |
|
|
50
|
+
| `custom` | Uses `customImage` — see below |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### `customImage`
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
baseImage: custom
|
|
58
|
+
customImage: ghcr.io/myorg/my-base:latest
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Only valid when `baseImage: custom`. Specifies the exact Docker image to use as the base.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### `containerName`
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
containerName: My Project
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Sets the `name` field in `devcontainer.json`. Used by VS Code to label the container.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### `overlays`
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
overlays:
|
|
79
|
+
- nodejs
|
|
80
|
+
- postgres
|
|
81
|
+
- grafana
|
|
82
|
+
- docker-sock
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Flat list of overlay IDs to include. This is the **preferred** way to declare overlays.
|
|
86
|
+
Dependency resolution runs automatically: if you select `grafana`, `prometheus` is added
|
|
87
|
+
because it is declared as `requires`.
|
|
88
|
+
|
|
89
|
+
See `docs/overlays.md` for the full overlay catalogue.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### `preset`
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
preset: web-api
|
|
97
|
+
presetChoices:
|
|
98
|
+
language: nodejs
|
|
99
|
+
database: postgres
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Expands a preset (meta-overlay) into a fixed set of overlays. Use `cs list --presets` to
|
|
103
|
+
browse available presets. `presetChoices` passes parameter values to the preset.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### `env`
|
|
108
|
+
|
|
109
|
+
Declare runtime environment variables once. The generation pipeline routes them to the correct
|
|
110
|
+
devcontainer artifact based on `stack`.
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
env:
|
|
114
|
+
# String shorthand — target is auto-detected
|
|
115
|
+
APP_NAME: my-app
|
|
116
|
+
|
|
117
|
+
# Long form — explicit routing target
|
|
118
|
+
DB_URL:
|
|
119
|
+
value: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/app
|
|
120
|
+
target: auto # default: plain→remoteEnv, compose→docker-compose environment
|
|
121
|
+
DEBUG:
|
|
122
|
+
value: 'true'
|
|
123
|
+
target: remoteEnv # always devcontainer.json remoteEnv
|
|
124
|
+
API_SECRET:
|
|
125
|
+
value: ${API_SECRET}
|
|
126
|
+
target: composeEnv # always docker-compose devcontainer environment (compose only)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### Routing table
|
|
130
|
+
|
|
131
|
+
| `target` | `stack: plain` | `stack: compose` |
|
|
132
|
+
| ---------------- | ----------------------------- | ------------------------------------------------------ |
|
|
133
|
+
| `auto` (default) | `devcontainer.json remoteEnv` | `docker-compose.yml services.devcontainer.environment` |
|
|
134
|
+
| `remoteEnv` | `devcontainer.json remoteEnv` | `devcontainer.json remoteEnv` |
|
|
135
|
+
| `composeEnv` | ❌ Error | `docker-compose.yml services.devcontainer.environment` |
|
|
136
|
+
|
|
137
|
+
#### `${VAR}` references
|
|
138
|
+
|
|
139
|
+
Values can reference variables from the root `.env` file using `${VAR}` or
|
|
140
|
+
`${VAR:-default}` syntax. These are resolved at generation time and written into the
|
|
141
|
+
appropriate output file.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### `mounts`
|
|
146
|
+
|
|
147
|
+
Declare filesystem mounts once. All mounts default to `devcontainer.json mounts[]` (`target: auto`).
|
|
148
|
+
Use `composeVolume` to route explicitly to docker-compose volumes on a compose stack.
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
mounts:
|
|
152
|
+
# String shorthand (escape hatch)
|
|
153
|
+
- 'source=${localWorkspaceFolder}/../libs,target=/workspace/libs,type=bind,readonly'
|
|
154
|
+
|
|
155
|
+
# Structured list form (preferred)
|
|
156
|
+
- source: ${HOME}/.codex
|
|
157
|
+
destination: /home/vscode/.codex
|
|
158
|
+
cached: true
|
|
159
|
+
# target: auto (default)
|
|
160
|
+
|
|
161
|
+
# Explicit target override
|
|
162
|
+
- source: certs
|
|
163
|
+
destination: /certs
|
|
164
|
+
type: volume
|
|
165
|
+
target: devcontainerMount
|
|
166
|
+
|
|
167
|
+
# Compose-only target
|
|
168
|
+
- source: ./logs
|
|
169
|
+
destination: /workspace/logs
|
|
170
|
+
target: composeVolume
|
|
171
|
+
|
|
172
|
+
# Raw-value fallback for advanced/custom cases
|
|
173
|
+
- value: './custom-src:/custom-dest:ro'
|
|
174
|
+
target: composeVolume
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### Routing table
|
|
178
|
+
|
|
179
|
+
| `target` | `stack: plain` | `stack: compose` |
|
|
180
|
+
| ------------------- | ---------------------------- | ---------------------------------------------------- |
|
|
181
|
+
| `auto` (default) | `devcontainer.json mounts[]` | `devcontainer.json mounts[]` |
|
|
182
|
+
| `devcontainerMount` | `devcontainer.json mounts[]` | `devcontainer.json mounts[]` |
|
|
183
|
+
| `composeVolume` | ❌ Error | `docker-compose.yml services.devcontainer.volumes[]` |
|
|
184
|
+
|
|
185
|
+
Use `devcontainerMount` when you want the same explicit `devcontainer.json mounts[]` routing regardless of stack.
|
|
186
|
+
Use `composeVolume` when you explicitly want compose volume routing.
|
|
187
|
+
|
|
188
|
+
Mounts declared here are applied **before** `customizations.devcontainerPatch` and
|
|
189
|
+
`customizations.dockerComposePatch`, so patch overrides are respected.
|
|
190
|
+
|
|
191
|
+
#### Mount spec formats
|
|
192
|
+
|
|
193
|
+
Structured entries are rendered into the correct target syntax automatically. You can still use
|
|
194
|
+
raw strings (or `value`) when needed:
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
mounts:
|
|
198
|
+
# devcontainer.json style (works with auto/devcontainerMount on any stack)
|
|
199
|
+
- 'source=${localWorkspaceFolder}/../shared,target=/workspace/shared,type=bind'
|
|
200
|
+
|
|
201
|
+
# Docker Compose short syntax (use with composeVolume on a compose stack)
|
|
202
|
+
- value: './local-data:/workspace/data'
|
|
203
|
+
target: composeVolume
|
|
204
|
+
|
|
205
|
+
# Docker named volume (devcontainer style)
|
|
206
|
+
- 'source=my-cache,target=/root/.cache,type=volume'
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
### `shell`
|
|
212
|
+
|
|
213
|
+
Declarative shell profile customizations. This is intended for aliases and shell snippets.
|
|
214
|
+
|
|
215
|
+
Use top-level `env` for environment variables (`export`-style values), not `shell`.
|
|
216
|
+
`shell` is for interactive shell UX (aliases, completions, snippets).
|
|
217
|
+
|
|
218
|
+
```yaml
|
|
219
|
+
shell:
|
|
220
|
+
aliases:
|
|
221
|
+
k: kubectl
|
|
222
|
+
kgp: kubectl get pods
|
|
223
|
+
snippets:
|
|
224
|
+
- source /etc/profile
|
|
225
|
+
# Shell-specific commands must be guarded — shell-init.sh is sourced by
|
|
226
|
+
# both ~/.bashrc and ~/.zshrc, so unguarded bash-only syntax causes errors
|
|
227
|
+
# in zsh and vice versa. Use $BASH_VERSION / $ZSH_VERSION to guard:
|
|
228
|
+
- '[ -n "$BASH_VERSION" ] && complete -C ''/usr/local/bin/aws_completer'' aws'
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Generation behavior:
|
|
232
|
+
|
|
233
|
+
- Writes `.devcontainer/scripts/shell-init.sh` with aliases/snippets
|
|
234
|
+
- Adds a postCreate hook that idempotently manages a marked block in:
|
|
235
|
+
- `~/.bashrc`
|
|
236
|
+
- `~/.zshrc`
|
|
237
|
+
- The managed block sources the generated `shell-init.sh`
|
|
238
|
+
|
|
239
|
+
> **Note:** `shell-init.sh` is sourced by **both** `~/.bashrc` and `~/.zshrc`.
|
|
240
|
+
> Keep `snippets` shell-agnostic, or guard shell-specific commands with
|
|
241
|
+
> `$BASH_VERSION` / `$ZSH_VERSION` checks (see example above).
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### `customizations`
|
|
246
|
+
|
|
247
|
+
Inline patches applied during generation. These are the same patches that can be placed in
|
|
248
|
+
`.devcontainer/custom/` — `superposition.yml` lets you keep them in the project file instead.
|
|
249
|
+
|
|
250
|
+
```yaml
|
|
251
|
+
customizations:
|
|
252
|
+
devcontainerPatch:
|
|
253
|
+
features:
|
|
254
|
+
ghcr.io/devcontainers-extra/features/apt-get-packages:1:
|
|
255
|
+
packages: jq curl
|
|
256
|
+
customizations:
|
|
257
|
+
vscode:
|
|
258
|
+
extensions:
|
|
259
|
+
- eamodio.gitlens
|
|
260
|
+
|
|
261
|
+
dockerComposePatch:
|
|
262
|
+
services:
|
|
263
|
+
devcontainer:
|
|
264
|
+
extra_hosts:
|
|
265
|
+
- 'host.docker.internal:host-gateway'
|
|
266
|
+
|
|
267
|
+
envTemplate:
|
|
268
|
+
POSTGRES_PASSWORD: postgres
|
|
269
|
+
MY_API_KEY: changeme
|
|
270
|
+
|
|
271
|
+
scripts:
|
|
272
|
+
postCreate:
|
|
273
|
+
- npm install
|
|
274
|
+
- npx prisma migrate dev
|
|
275
|
+
postStart:
|
|
276
|
+
- pg_isready -h postgres || true
|
|
277
|
+
|
|
278
|
+
files:
|
|
279
|
+
- path: config/app.yml
|
|
280
|
+
content: |
|
|
281
|
+
database:
|
|
282
|
+
host: postgres
|
|
283
|
+
port: 5432
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
#### Application order
|
|
287
|
+
|
|
288
|
+
1. Base template loaded
|
|
289
|
+
2. Overlays applied in order
|
|
290
|
+
3. Port offsets applied
|
|
291
|
+
4. Project `env` applied
|
|
292
|
+
5. Project `mounts` applied
|
|
293
|
+
6. `customizations.devcontainerPatch` merged (deepMerge, arrays deduplicated)
|
|
294
|
+
7. `customizations.dockerComposePatch` merged
|
|
295
|
+
8. Target-specific patches applied
|
|
296
|
+
9. Files written
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
### `portOffset`
|
|
301
|
+
|
|
302
|
+
```yaml
|
|
303
|
+
portOffset: 100
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Shifts all overlay-declared host ports by the given integer. Useful when running multiple
|
|
307
|
+
instances of the same stack on one machine (e.g. feature branches in parallel).
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
### `outputPath`
|
|
312
|
+
|
|
313
|
+
```yaml
|
|
314
|
+
outputPath: ./.devcontainer
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Where to write the generated devcontainer files. Default: `./.devcontainer`.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
### `target`
|
|
322
|
+
|
|
323
|
+
```yaml
|
|
324
|
+
target: codespaces # local | codespaces | gitpod | devpod
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Selects a deployment-target profile that applies environment-specific patches.
|
|
328
|
+
|
|
329
|
+
See [deployment-targets.md](deployment-targets.md) for details.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
### `minimal`
|
|
334
|
+
|
|
335
|
+
```yaml
|
|
336
|
+
minimal: true
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
When `true`, overlays marked with `minimal: true` in their `overlay.yml` are excluded. Useful
|
|
340
|
+
for CI environments where extra tooling is unnecessary.
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
### `editor`
|
|
345
|
+
|
|
346
|
+
```yaml
|
|
347
|
+
editor: vscode # vscode | jetbrains | none
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Selects the editor customization profile:
|
|
351
|
+
|
|
352
|
+
| Value | Effect |
|
|
353
|
+
| ----------- | ---------------------------------------------------------------------------- |
|
|
354
|
+
| `vscode` | Include VS Code extensions and settings from all selected overlays (default) |
|
|
355
|
+
| `jetbrains` | Remove VS Code customizations; add `customizations.jetbrains` block |
|
|
356
|
+
| `none` | Remove VS Code customizations entirely |
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
### `parameters`
|
|
361
|
+
|
|
362
|
+
```yaml
|
|
363
|
+
parameters:
|
|
364
|
+
POSTGRES_VERSION: '16'
|
|
365
|
+
POSTGRES_PORT: '5433'
|
|
366
|
+
REDIS_PASSWORD: mysecret
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Overlay parameter values. Keys correspond to parameter names declared in `overlay.yml`
|
|
370
|
+
`parameters:` sections. Values are substituted for `{{cs.KEY}}` tokens throughout generated
|
|
371
|
+
files.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Complete example
|
|
376
|
+
|
|
377
|
+
```yaml
|
|
378
|
+
stack: compose
|
|
379
|
+
baseImage: bookworm
|
|
380
|
+
containerName: My Web API
|
|
381
|
+
|
|
382
|
+
overlays:
|
|
383
|
+
- nodejs
|
|
384
|
+
- postgres
|
|
385
|
+
- redis
|
|
386
|
+
- grafana
|
|
387
|
+
|
|
388
|
+
env:
|
|
389
|
+
APP_ENV: development
|
|
390
|
+
NODE_ENV: development
|
|
391
|
+
DATABASE_URL:
|
|
392
|
+
value: 'postgres://postgres:${POSTGRES_PASSWORD:-postgres}@postgres:5432/app'
|
|
393
|
+
target: composeEnv
|
|
394
|
+
|
|
395
|
+
mounts:
|
|
396
|
+
# Bind-mount shared workspace tools (plain and compose auto-routing)
|
|
397
|
+
- 'source=${localWorkspaceFolder}/../tools,target=/workspace/tools,type=bind,readonly'
|
|
398
|
+
# Always inject local SSL certificates into devcontainer.json
|
|
399
|
+
- value: 'source=${localWorkspaceFolder}/.certs,target=/usr/local/share/ca-certificates,type=bind,readonly'
|
|
400
|
+
target: devcontainerMount
|
|
401
|
+
|
|
402
|
+
portOffset: 0
|
|
403
|
+
|
|
404
|
+
target: local
|
|
405
|
+
|
|
406
|
+
customizations:
|
|
407
|
+
envTemplate:
|
|
408
|
+
POSTGRES_PASSWORD: postgres
|
|
409
|
+
REDIS_PASSWORD: ''
|
|
410
|
+
devcontainerPatch:
|
|
411
|
+
features:
|
|
412
|
+
ghcr.io/devcontainers-extra/features/apt-get-packages:1:
|
|
413
|
+
packages: jq httpie
|
|
414
|
+
scripts:
|
|
415
|
+
postCreate:
|
|
416
|
+
- npm install
|
|
417
|
+
postStart:
|
|
418
|
+
- pg_isready -h postgres -U postgres || true
|
|
419
|
+
|
|
420
|
+
parameters:
|
|
421
|
+
POSTGRES_VERSION: '16'
|
|
422
|
+
REDIS_PORT: '6379'
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## Legacy fields (deprecated)
|
|
428
|
+
|
|
429
|
+
These category arrays are accepted for backward compatibility but `overlays:` is preferred:
|
|
430
|
+
|
|
431
|
+
```yaml
|
|
432
|
+
# Deprecated — use overlays: [nodejs, python] instead
|
|
433
|
+
language:
|
|
434
|
+
- nodejs
|
|
435
|
+
- python
|
|
436
|
+
|
|
437
|
+
# Deprecated — use overlays: [postgres, redis] instead
|
|
438
|
+
database:
|
|
439
|
+
- postgres
|
|
440
|
+
- redis
|
|
441
|
+
|
|
442
|
+
# Deprecated — use overlays: [playwright] instead
|
|
443
|
+
playwright: true
|
|
444
|
+
|
|
445
|
+
# Deprecated — use overlays: [azure-cli] instead
|
|
446
|
+
cloudTools:
|
|
447
|
+
- azure-cli
|
|
448
|
+
|
|
449
|
+
# Deprecated — use overlays: [docker-in-docker] instead
|
|
450
|
+
devTools:
|
|
451
|
+
- docker-in-docker
|
|
452
|
+
|
|
453
|
+
# Deprecated — use overlays: [prometheus] instead
|
|
454
|
+
observability:
|
|
455
|
+
- prometheus
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## See also
|
|
461
|
+
|
|
462
|
+
- [Overlays catalogue](overlays.md)
|
|
463
|
+
- [Custom patches](custom-patches.md)
|
|
464
|
+
- [Deployment targets](deployment-targets.md)
|
|
465
|
+
- [Presets](presets.md)
|
|
466
|
+
- [Merge strategy](merge-strategy.md)
|
|
467
|
+
- [Workflows and regen](workflows.md)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Full Observability Stack Preset
|
|
2
|
+
# Complete metrics, logs, traces, and alerting for any project
|
|
3
|
+
|
|
4
|
+
id: full-observability
|
|
5
|
+
name: Full Observability Stack
|
|
6
|
+
description: Prometheus, Grafana, Loki, Jaeger/Tempo, OpenTelemetry Collector, Alertmanager, and Promtail — bolt-on monitoring for any project
|
|
7
|
+
type: meta
|
|
8
|
+
category: preset
|
|
9
|
+
supports: [compose] # Requires Docker Compose for all sidecar services
|
|
10
|
+
tags: [preset, observability, monitoring, metrics, logging, tracing, prometheus, grafana, loki]
|
|
11
|
+
|
|
12
|
+
selects:
|
|
13
|
+
required:
|
|
14
|
+
- prometheus
|
|
15
|
+
- grafana
|
|
16
|
+
- loki
|
|
17
|
+
- otel-collector
|
|
18
|
+
- alertmanager
|
|
19
|
+
- promtail
|
|
20
|
+
|
|
21
|
+
userChoice: {}
|
|
22
|
+
|
|
23
|
+
parameters:
|
|
24
|
+
tracing:
|
|
25
|
+
description: 'Distributed tracing backend'
|
|
26
|
+
default: jaeger
|
|
27
|
+
options:
|
|
28
|
+
- id: jaeger
|
|
29
|
+
overlays: [jaeger]
|
|
30
|
+
description: 'Jaeger — battle-tested, native OTLP support, built-in UI'
|
|
31
|
+
- id: tempo
|
|
32
|
+
overlays: [tempo]
|
|
33
|
+
description: 'Grafana Tempo — stores traces in object storage, integrates with Grafana'
|
|
34
|
+
- id: both
|
|
35
|
+
overlays: [jaeger, tempo]
|
|
36
|
+
description: 'Both Jaeger and Tempo (useful for migration)'
|
|
37
|
+
- id: none
|
|
38
|
+
overlays: []
|
|
39
|
+
description: 'No tracing backend — collector still accepts spans'
|
|
40
|
+
|
|
41
|
+
glueConfig:
|
|
42
|
+
environment:
|
|
43
|
+
OTEL_EXPORTER_OTLP_ENDPOINT: 'http://otel-collector:4317'
|
|
44
|
+
OTEL_METRICS_EXPORTER: 'otlp'
|
|
45
|
+
OTEL_TRACES_EXPORTER: 'otlp'
|
|
46
|
+
OTEL_LOGS_EXPORTER: 'otlp'
|
|
47
|
+
|
|
48
|
+
portMappings:
|
|
49
|
+
grafana: 3000
|
|
50
|
+
prometheus: 9090
|
|
51
|
+
jaeger-ui: 16686
|
|
52
|
+
alertmanager: 9093
|
|
53
|
+
otel-grpc: 4317
|
|
54
|
+
otel-http: 4318
|
|
55
|
+
|
|
56
|
+
readme: |
|
|
57
|
+
## Full Observability Stack
|
|
58
|
+
|
|
59
|
+
This devcontainer adds a complete observability platform alongside your existing services.
|
|
60
|
+
|
|
61
|
+
### Services
|
|
62
|
+
|
|
63
|
+
| Service | Port | Purpose |
|
|
64
|
+
|---------|------|---------|
|
|
65
|
+
| Grafana | 3000 | Unified dashboards (metrics + logs + traces) |
|
|
66
|
+
| Prometheus | 9090 | Metrics collection and storage |
|
|
67
|
+
| Loki | 3100 | Log aggregation |
|
|
68
|
+
| Promtail | — | Log shipping agent (reads container logs) |
|
|
69
|
+
| OTel Collector | 4317 / 4318 | Telemetry pipeline (gRPC / HTTP) |
|
|
70
|
+
| Alertmanager | 9093 | Alert routing and silencing |
|
|
71
|
+
| Jaeger / Tempo | 16686 | Distributed tracing UI / backend |
|
|
72
|
+
|
|
73
|
+
### Access
|
|
74
|
+
|
|
75
|
+
- **Grafana**: http://localhost:3000 — default login `admin` / `admin`
|
|
76
|
+
- **Prometheus**: http://localhost:9090
|
|
77
|
+
- **Alertmanager**: http://localhost:9093
|
|
78
|
+
- **Jaeger UI** _(if selected)_: http://localhost:16686
|
|
79
|
+
|
|
80
|
+
### Instrumenting Your Application
|
|
81
|
+
|
|
82
|
+
Configure your service to send telemetry to the OTel Collector:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Already set in your environment:
|
|
86
|
+
OTEL_EXPORTER_OTLP_ENDPOINT="http://otel-collector:4317"
|
|
87
|
+
OTEL_METRICS_EXPORTER="otlp"
|
|
88
|
+
OTEL_TRACES_EXPORTER="otlp"
|
|
89
|
+
OTEL_LOGS_EXPORTER="otlp"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Install the OpenTelemetry SDK for your language, then traces and metrics
|
|
93
|
+
will flow automatically: App → OTel Collector → Jaeger / Prometheus / Loki.
|
|
94
|
+
|
|
95
|
+
### Grafana Datasources
|
|
96
|
+
|
|
97
|
+
The following datasources are pre-configured in Grafana:
|
|
98
|
+
|
|
99
|
+
- Prometheus (metrics)
|
|
100
|
+
- Loki (logs)
|
|
101
|
+
- Jaeger or Tempo (traces, if selected)
|
|
102
|
+
|
|
103
|
+
### Alertmanager
|
|
104
|
+
|
|
105
|
+
Add alert rules to Prometheus by creating a `prometheus-rules.yml` file
|
|
106
|
+
and mounting it into the Prometheus service, or use the Grafana alerting UI.
|
|
107
|
+
|
|
108
|
+
### Next Steps
|
|
109
|
+
|
|
110
|
+
- Browse the Grafana Explore tab to query logs and traces
|
|
111
|
+
- Import community dashboards from grafana.com/grafana/dashboards
|
|
112
|
+
- Configure Alertmanager routes in `.devcontainer/alertmanager.yml`
|
|
113
|
+
- Add your service's metrics endpoint to `prometheus-scrape-configs.yml`
|