container-superposition 0.1.1 → 0.1.3

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.
Files changed (136) hide show
  1. package/README.md +206 -1
  2. package/dist/scripts/init.js +235 -179
  3. package/dist/scripts/init.js.map +1 -1
  4. package/dist/tool/commands/doctor.d.ts +15 -0
  5. package/dist/tool/commands/doctor.d.ts.map +1 -0
  6. package/dist/tool/commands/doctor.js +862 -0
  7. package/dist/tool/commands/doctor.js.map +1 -0
  8. package/dist/tool/commands/explain.d.ts +13 -0
  9. package/dist/tool/commands/explain.d.ts.map +1 -0
  10. package/dist/tool/commands/explain.js +211 -0
  11. package/dist/tool/commands/explain.js.map +1 -0
  12. package/dist/tool/commands/list.d.ts +16 -0
  13. package/dist/tool/commands/list.d.ts.map +1 -0
  14. package/dist/tool/commands/list.js +121 -0
  15. package/dist/tool/commands/list.js.map +1 -0
  16. package/dist/tool/commands/plan.d.ts +16 -0
  17. package/dist/tool/commands/plan.d.ts.map +1 -0
  18. package/dist/tool/commands/plan.js +329 -0
  19. package/dist/tool/commands/plan.js.map +1 -0
  20. package/dist/tool/questionnaire/composer.d.ts +6 -1
  21. package/dist/tool/questionnaire/composer.d.ts.map +1 -1
  22. package/dist/tool/questionnaire/composer.js +300 -202
  23. package/dist/tool/questionnaire/composer.js.map +1 -1
  24. package/dist/tool/readme/markdown-parser.d.ts.map +1 -1
  25. package/dist/tool/readme/markdown-parser.js.map +1 -1
  26. package/dist/tool/readme/readme-generator.d.ts.map +1 -1
  27. package/dist/tool/readme/readme-generator.js +11 -6
  28. package/dist/tool/readme/readme-generator.js.map +1 -1
  29. package/dist/tool/schema/deployment-targets.d.ts +77 -0
  30. package/dist/tool/schema/deployment-targets.d.ts.map +1 -0
  31. package/dist/tool/schema/deployment-targets.js +91 -0
  32. package/dist/tool/schema/deployment-targets.js.map +1 -0
  33. package/dist/tool/schema/manifest-migrations.d.ts +51 -0
  34. package/dist/tool/schema/manifest-migrations.d.ts.map +1 -0
  35. package/dist/tool/schema/manifest-migrations.js +159 -0
  36. package/dist/tool/schema/manifest-migrations.js.map +1 -0
  37. package/dist/tool/schema/overlay-loader.d.ts +1 -1
  38. package/dist/tool/schema/overlay-loader.d.ts.map +1 -1
  39. package/dist/tool/schema/overlay-loader.js +42 -14
  40. package/dist/tool/schema/overlay-loader.js.map +1 -1
  41. package/dist/tool/schema/types.d.ts +44 -2
  42. package/dist/tool/schema/types.d.ts.map +1 -1
  43. package/dist/tool/utils/merge.d.ts +134 -0
  44. package/dist/tool/utils/merge.d.ts.map +1 -0
  45. package/dist/tool/utils/merge.js +277 -0
  46. package/dist/tool/utils/merge.js.map +1 -0
  47. package/dist/tool/utils/port-utils.d.ts +29 -0
  48. package/dist/tool/utils/port-utils.d.ts.map +1 -0
  49. package/dist/tool/utils/port-utils.js +128 -0
  50. package/dist/tool/utils/port-utils.js.map +1 -0
  51. package/dist/tool/utils/version.d.ts +9 -0
  52. package/dist/tool/utils/version.d.ts.map +1 -0
  53. package/dist/tool/utils/version.js +32 -0
  54. package/dist/tool/utils/version.js.map +1 -0
  55. package/docs/architecture.md +25 -21
  56. package/docs/deployment-targets.md +150 -0
  57. package/docs/discovery-commands.md +442 -0
  58. package/docs/merge-strategy.md +700 -0
  59. package/docs/minimal-and-editor.md +265 -0
  60. package/docs/overlay-imports.md +209 -0
  61. package/docs/overlay-manifest-refactoring.md +2 -2
  62. package/docs/overlay-metadata-archive.md +1 -1
  63. package/docs/overlays.md +91 -23
  64. package/docs/presets-architecture.md +3 -3
  65. package/docs/presets.md +1 -1
  66. package/docs/publishing.md +36 -35
  67. package/docs/team-workflow.md +540 -0
  68. package/overlays/.presets/data-engineering.yml +392 -0
  69. package/overlays/.presets/event-sourced-service.yml +262 -0
  70. package/overlays/.presets/frontend.yml +287 -0
  71. package/overlays/.presets/k8s-operator-dev.yml +462 -0
  72. package/overlays/.registry/README.md +1 -1
  73. package/overlays/.registry/deployment-targets.yml +54 -0
  74. package/overlays/.shared/README.md +43 -0
  75. package/overlays/.shared/compose/common-healthchecks.yml +38 -0
  76. package/overlays/.shared/otel/instrumentation.env +20 -0
  77. package/overlays/.shared/otel/otel-base-config.yaml +30 -0
  78. package/overlays/.shared/vscode/recommended-extensions.json +14 -0
  79. package/overlays/README.md +1 -1
  80. package/overlays/codex/overlay.yml +1 -0
  81. package/overlays/duckdb/README.md +274 -0
  82. package/overlays/duckdb/devcontainer.patch.json +10 -0
  83. package/overlays/duckdb/overlay.yml +17 -0
  84. package/overlays/duckdb/setup.sh +45 -0
  85. package/overlays/duckdb/verify.sh +32 -0
  86. package/overlays/git-helpers/overlay.yml +1 -0
  87. package/overlays/grafana/README.md +5 -5
  88. package/overlays/grafana/dashboard-provider.yml +1 -1
  89. package/overlays/grafana/docker-compose.yml +2 -2
  90. package/overlays/grafana/overlay.yml +6 -1
  91. package/overlays/jaeger/overlay.yml +16 -3
  92. package/overlays/jupyter/.env.example +6 -0
  93. package/overlays/jupyter/README.md +210 -0
  94. package/overlays/jupyter/devcontainer.patch.json +14 -0
  95. package/overlays/jupyter/docker-compose.yml +23 -0
  96. package/overlays/jupyter/overlay.yml +18 -0
  97. package/overlays/jupyter/verify.sh +35 -0
  98. package/overlays/kind/README.md +221 -0
  99. package/overlays/kind/devcontainer.patch.json +10 -0
  100. package/overlays/kind/overlay.yml +18 -0
  101. package/overlays/kind/setup.sh +43 -0
  102. package/overlays/kind/verify.sh +40 -0
  103. package/overlays/localstack/.env.example +6 -0
  104. package/overlays/localstack/README.md +188 -0
  105. package/overlays/localstack/devcontainer.patch.json +21 -0
  106. package/overlays/localstack/docker-compose.yml +25 -0
  107. package/overlays/localstack/overlay.yml +18 -0
  108. package/overlays/localstack/verify.sh +47 -0
  109. package/overlays/loki/overlay.yml +6 -1
  110. package/overlays/modern-cli-tools/overlay.yml +1 -0
  111. package/overlays/mongodb/overlay.yml +12 -2
  112. package/overlays/mysql/overlay.yml +12 -2
  113. package/overlays/nats/overlay.yml +12 -2
  114. package/overlays/openapi-tools/README.md +243 -0
  115. package/overlays/openapi-tools/devcontainer.patch.json +10 -0
  116. package/overlays/openapi-tools/overlay.yml +16 -0
  117. package/overlays/openapi-tools/setup.sh +45 -0
  118. package/overlays/openapi-tools/verify.sh +51 -0
  119. package/overlays/otel-collector/overlay.yml.example +26 -0
  120. package/overlays/postgres/overlay.yml +6 -1
  121. package/overlays/prometheus/overlay.yml +6 -1
  122. package/overlays/rabbitmq/overlay.yml +12 -2
  123. package/overlays/redis/overlay.yml +6 -1
  124. package/overlays/tilt/README.md +259 -0
  125. package/overlays/tilt/devcontainer.patch.json +17 -0
  126. package/overlays/tilt/overlay.yml +19 -0
  127. package/overlays/tilt/setup.sh +25 -0
  128. package/overlays/tilt/verify.sh +24 -0
  129. package/package.json +8 -6
  130. package/tool/README.md +12 -16
  131. package/tool/schema/overlay-manifest.schema.json +64 -4
  132. package/tool/schema/superposition-manifest.schema.json +104 -0
  133. /package/overlays/{presets → .presets}/docs-site.yml +0 -0
  134. /package/overlays/{presets → .presets}/fullstack.yml +0 -0
  135. /package/overlays/{presets → .presets}/microservice.yml +0 -0
  136. /package/overlays/{presets → .presets}/web-api.yml +0 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "runServices": ["jupyter"],
4
+ "forwardPorts": [8888],
5
+ "portsAttributes": {
6
+ "8888": {
7
+ "label": "Jupyter Notebook",
8
+ "onAutoForward": "openBrowser"
9
+ }
10
+ },
11
+ "remoteEnv": {
12
+ "JUPYTER_URL": "http://jupyter:8888"
13
+ }
14
+ }
@@ -0,0 +1,23 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ jupyter:
5
+ image: jupyter/minimal-notebook:${JUPYTER_VERSION:-latest}
6
+ restart: unless-stopped
7
+ volumes:
8
+ - jupyter-data:/home/jovyan/work
9
+ - ${JUPYTER_NOTEBOOKS_PATH:-./notebooks}:/home/jovyan/notebooks
10
+ environment:
11
+ JUPYTER_ENABLE_LAB: ${JUPYTER_ENABLE_LAB:-yes}
12
+ JUPYTER_TOKEN: ${JUPYTER_TOKEN:-}
13
+ ports:
14
+ - '${JUPYTER_PORT:-8888}:8888'
15
+ networks:
16
+ - devnet
17
+ command: start-notebook.sh --NotebookApp.token='' --NotebookApp.password=''
18
+
19
+ volumes:
20
+ jupyter-data:
21
+
22
+ networks:
23
+ devnet:
@@ -0,0 +1,18 @@
1
+ id: jupyter
2
+ name: Jupyter
3
+ description: Jupyter notebook server for interactive computing and data science
4
+ category: language
5
+ supports:
6
+ - compose
7
+ requires:
8
+ - python
9
+ suggests: []
10
+ conflicts: []
11
+ tags:
12
+ - language
13
+ - jupyter
14
+ - python
15
+ - notebook
16
+ - data-science
17
+ ports:
18
+ - 8888
@@ -0,0 +1,35 @@
1
+ #!/bin/bash
2
+ # Verification script for Jupyter overlay
3
+ # Confirms Jupyter is running
4
+
5
+ set -e
6
+
7
+ echo "🔍 Verifying Jupyter overlay..."
8
+ echo ""
9
+
10
+ # Check if Jupyter service is running
11
+ echo "1️⃣ Checking Jupyter service..."
12
+ if command -v curl &> /dev/null; then
13
+ # Wait up to 30 seconds for Jupyter to be ready
14
+ JUPYTER_READY=false
15
+ for i in {1..30}; do
16
+ if curl -s http://jupyter:8888 &> /dev/null; then
17
+ echo " ✅ Jupyter service is ready"
18
+ JUPYTER_READY=true
19
+ break
20
+ fi
21
+ sleep 1
22
+ done
23
+
24
+ if [ "$JUPYTER_READY" = false ]; then
25
+ echo " ❌ Jupyter service not ready after 30 seconds"
26
+ exit 1
27
+ fi
28
+ else
29
+ echo " ⚠️ curl not found, skipping service check"
30
+ fi
31
+
32
+ echo ""
33
+ echo "✅ Jupyter overlay verification complete"
34
+ echo ""
35
+ echo "ℹ️ Access Jupyter at http://localhost:8888"
@@ -0,0 +1,221 @@
1
+ # kind (Kubernetes in Docker) Overlay
2
+
3
+ Local Kubernetes cluster for development and testing using kind.
4
+
5
+ ## Features
6
+
7
+ - **kind** - Kubernetes in Docker for local cluster creation
8
+ - **Multi-node support** - Create single or multi-node clusters
9
+ - **Fast startup** - Lightweight compared to traditional VMs
10
+ - **Docker-based** - Uses Docker containers as Kubernetes nodes
11
+ - **Production-like** - Runs actual Kubernetes, not a simulator
12
+
13
+ ## How It Works
14
+
15
+ This overlay installs kind (Kubernetes in Docker), a tool for running local Kubernetes clusters using Docker containers as nodes. It requires Docker-in-Docker to function.
16
+
17
+ **Dependencies:**
18
+
19
+ - `docker-in-docker` (required) - Provides Docker daemon for kind clusters
20
+
21
+ **Suggested overlays:**
22
+
23
+ - `kubectl-helm` - Kubernetes CLI and Helm package manager
24
+
25
+ ## Installation
26
+
27
+ kind is installed automatically during devcontainer creation via `setup.sh`:
28
+
29
+ - Downloads kind binary for your architecture (amd64/arm64)
30
+ - Installs to `/usr/local/bin/kind`
31
+ - Verifies Docker access
32
+
33
+ ## Common Commands
34
+
35
+ ### Cluster Management
36
+
37
+ ```bash
38
+ # Create a cluster
39
+ kind create cluster --name dev
40
+
41
+ # Create cluster with custom config
42
+ cat <<EOF | kind create cluster --config=-
43
+ kind: Cluster
44
+ apiVersion: kind.x-k8s.io/v1alpha4
45
+ nodes:
46
+ - role: control-plane
47
+ - role: worker
48
+ - role: worker
49
+ EOF
50
+
51
+ # List clusters
52
+ kind get clusters
53
+
54
+ # Delete a cluster
55
+ kind delete cluster --name dev
56
+ ```
57
+
58
+ ### Working with Clusters
59
+
60
+ ```bash
61
+ # Get kubeconfig
62
+ kind get kubeconfig --name dev
63
+
64
+ # Load Docker image into cluster
65
+ docker pull nginx:latest
66
+ kind load docker-image nginx:latest --name dev
67
+
68
+ # Export logs
69
+ kind export logs /tmp/kind-logs --name dev
70
+ ```
71
+
72
+ ### kubectl Integration
73
+
74
+ ```bash
75
+ # kind automatically updates kubeconfig
76
+ kubectl cluster-info --context kind-dev
77
+
78
+ # Deploy workload
79
+ kubectl create deployment nginx --image=nginx
80
+ kubectl expose deployment nginx --port=80 --type=NodePort
81
+
82
+ # Access service
83
+ kubectl port-forward service/nginx 8080:80
84
+ ```
85
+
86
+ ## Configuration
87
+
88
+ ### Custom Cluster Configuration
89
+
90
+ Create a `kind-config.yaml`:
91
+
92
+ ```yaml
93
+ kind: Cluster
94
+ apiVersion: kind.x-k8s.io/v1alpha4
95
+ nodes:
96
+ - role: control-plane
97
+ kubeadmConfigPatches:
98
+ - |
99
+ kind: InitConfiguration
100
+ nodeRegistration:
101
+ kubeletExtraArgs:
102
+ node-labels: "ingress-ready=true"
103
+ extraPortMappings:
104
+ - containerPort: 80
105
+ hostPort: 80
106
+ protocol: TCP
107
+ - containerPort: 443
108
+ hostPort: 443
109
+ protocol: TCP
110
+ - role: worker
111
+ - role: worker
112
+ ```
113
+
114
+ Use it:
115
+
116
+ ```bash
117
+ kind create cluster --name dev --config kind-config.yaml
118
+ ```
119
+
120
+ ### Version Control
121
+
122
+ Specify kind version in setup.sh via environment variable:
123
+
124
+ ```bash
125
+ KIND_VERSION=v0.22.0
126
+ ```
127
+
128
+ ## Use Cases
129
+
130
+ - **Kubernetes development** - Develop and test K8s applications locally
131
+ - **Operator development** - Build and test Kubernetes operators
132
+ - **CI/CD testing** - Run K8s tests in CI pipelines
133
+ - **Learning Kubernetes** - Experiment with K8s without cloud costs
134
+ - **Multi-cluster scenarios** - Test federation, service mesh across clusters
135
+
136
+ **Integrates well with:**
137
+
138
+ - `kubectl-helm` - Kubernetes CLI and Helm
139
+ - `tilt` - Live reload for Kubernetes development
140
+ - `skaffold` - Build/deploy automation for K8s
141
+ - `terraform` - Infrastructure as Code
142
+ - `nodejs`, `python`, `dotnet` - Application development
143
+
144
+ ## Benefits vs k3d
145
+
146
+ | Feature | kind | k3d |
147
+ | --------------------- | -------------------------- | ---------------------------- |
148
+ | **Distribution** | ✅ Full Kubernetes | ⚠️ k3s (lightweight variant) |
149
+ | **Conformance** | ✅ 100% conformant | ✅ High conformance |
150
+ | **Speed** | ⚠️ Moderate startup | ✅ Faster startup |
151
+ | **Resource Usage** | ⚠️ Higher | ✅ Lower |
152
+ | **Production Parity** | ✅ Identical to production | ⚠️ Some differences |
153
+ | **Maturity** | ✅ CNCF project | ✅ CNCF sandbox |
154
+
155
+ **When to use kind:**
156
+
157
+ - Need 100% Kubernetes compatibility
158
+ - Testing for production environments
159
+ - Developing Kubernetes itself or operators
160
+ - Don't mind slightly higher resource usage
161
+
162
+ **When to use k3d:**
163
+
164
+ - Need faster iteration cycles
165
+ - Limited system resources
166
+ - Don't need full Kubernetes features
167
+
168
+ ## Troubleshooting
169
+
170
+ ### Cluster Creation Fails
171
+
172
+ Check Docker is running:
173
+
174
+ ```bash
175
+ docker ps
176
+ ```
177
+
178
+ Check Docker has sufficient resources (4GB+ RAM recommended).
179
+
180
+ ### Network Issues
181
+
182
+ kind uses Docker networks. If having network issues:
183
+
184
+ ```bash
185
+ # Delete and recreate cluster
186
+ kind delete cluster --name dev
187
+ kind create cluster --name dev
188
+ ```
189
+
190
+ ### Image Pull Failures
191
+
192
+ Load images manually:
193
+
194
+ ```bash
195
+ docker pull myimage:tag
196
+ kind load docker-image myimage:tag --name dev
197
+ ```
198
+
199
+ ### Persistent Volumes
200
+
201
+ kind uses local path provisioner. PVs are stored in Docker containers:
202
+
203
+ ```bash
204
+ # Inspect node container
205
+ docker exec -it dev-control-plane ls /var/local-path-provisioner
206
+ ```
207
+
208
+ ## References
209
+
210
+ - [kind Documentation](https://kind.sigs.k8s.io/)
211
+ - [kind Quick Start](https://kind.sigs.k8s.io/docs/user/quick-start/)
212
+ - [kind Configuration](https://kind.sigs.k8s.io/docs/user/configuration/)
213
+ - [Kubernetes Documentation](https://kubernetes.io/docs/)
214
+
215
+ **Related Overlays:**
216
+
217
+ - `docker-in-docker` - Required for kind to function
218
+ - `kubectl-helm` - Kubernetes CLI and Helm
219
+ - `tilt` - Live reload for Kubernetes
220
+ - `skaffold` - K8s build orchestration
221
+ - `k3d` - Alternative lightweight K8s (conflicts)
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "features": {
4
+ "./features/cross-distro-packages": {
5
+ "apt": "curl",
6
+ "apk": "curl"
7
+ }
8
+ },
9
+ "postCreateCommand": "bash .devcontainer/scripts/setup-kind.sh"
10
+ }
@@ -0,0 +1,18 @@
1
+ id: kind
2
+ name: kind (Kubernetes in Docker)
3
+ description: Local Kubernetes cluster for development and testing
4
+ category: cloud
5
+ supports: []
6
+ requires:
7
+ - docker-in-docker
8
+ suggests:
9
+ - kubectl-helm
10
+ conflicts:
11
+ - k3d
12
+ tags:
13
+ - cloud
14
+ - kubernetes
15
+ - k8s
16
+ - kind
17
+ - testing
18
+ ports: []
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+ # Setup script for kind (Kubernetes in Docker)
3
+
4
+ set -e
5
+
6
+ echo "🔧 Setting up kind (Kubernetes in Docker)..."
7
+
8
+ # Detect architecture
9
+ ARCH=$(uname -m)
10
+ case $ARCH in
11
+ x86_64)
12
+ KIND_ARCH="amd64"
13
+ ;;
14
+ aarch64|arm64)
15
+ KIND_ARCH="arm64"
16
+ ;;
17
+ *)
18
+ echo "❌ Unsupported architecture: $ARCH"
19
+ exit 1
20
+ ;;
21
+ esac
22
+
23
+ # Install kind
24
+ KIND_VERSION="${KIND_VERSION:-v0.22.0}"
25
+ echo "📦 Installing kind ${KIND_VERSION}..."
26
+
27
+ curl -Lo /tmp/kind "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-${KIND_ARCH}"
28
+ chmod +x /tmp/kind
29
+ sudo mv /tmp/kind /usr/local/bin/kind
30
+
31
+ # Verify installation
32
+ if command -v kind &> /dev/null; then
33
+ echo "✅ kind installed successfully"
34
+ kind version
35
+ else
36
+ echo "❌ kind installation failed"
37
+ exit 1
38
+ fi
39
+
40
+ echo "✅ kind setup complete"
41
+ echo ""
42
+ echo "ℹ️ To create a cluster, run:"
43
+ echo " kind create cluster --name dev"
@@ -0,0 +1,40 @@
1
+ #!/bin/bash
2
+ # Verification script for kind overlay
3
+ # Confirms kind is installed
4
+
5
+ set -e
6
+
7
+ echo "🔍 Verifying kind overlay..."
8
+ echo ""
9
+
10
+ # Check kind is installed
11
+ echo "1️⃣ Checking kind installation..."
12
+ if command -v kind &> /dev/null; then
13
+ kind version
14
+ echo " ✅ kind is installed"
15
+ else
16
+ echo " ❌ kind is not installed"
17
+ exit 1
18
+ fi
19
+
20
+ # Check Docker is available (required for kind)
21
+ echo ""
22
+ echo "2️⃣ Checking Docker availability..."
23
+ if command -v docker &> /dev/null; then
24
+ docker version --format '{{.Server.Version}}' &> /dev/null
25
+ if [ $? -eq 0 ]; then
26
+ echo " ✅ Docker is available"
27
+ else
28
+ echo " ❌ Docker daemon not accessible"
29
+ exit 1
30
+ fi
31
+ else
32
+ echo " ❌ Docker CLI not found"
33
+ exit 1
34
+ fi
35
+
36
+ echo ""
37
+ echo "✅ kind overlay verification complete"
38
+ echo ""
39
+ echo "ℹ️ To create a cluster, run:"
40
+ echo " kind create cluster --name dev"
@@ -0,0 +1,6 @@
1
+ # LocalStack Configuration
2
+ LOCALSTACK_VERSION=latest
3
+ LOCALSTACK_SERVICES=s3,sqs,sns,dynamodb,lambda,cloudformation
4
+ LOCALSTACK_DEBUG=0
5
+ LOCALSTACK_EDGE_PORT=4566
6
+ LOCALSTACK_S3_PORT=4571
@@ -0,0 +1,188 @@
1
+ # LocalStack Overlay
2
+
3
+ Local AWS cloud stack for development and testing without requiring an AWS account.
4
+
5
+ ## Features
6
+
7
+ - **LocalStack** - Full AWS cloud emulator running locally
8
+ - **Multiple AWS Services** - S3, DynamoDB, SQS, SNS, Lambda, CloudFormation, and more
9
+ - **Docker Compose service** - Runs as separate container
10
+ - **Persistent storage** - Data survives container restarts
11
+ - **Pre-configured environment** - AWS CLI ready to use with LocalStack endpoints
12
+
13
+ ## How It Works
14
+
15
+ This overlay adds LocalStack as a Docker Compose service that emulates AWS cloud services locally. The service runs in its own container and is accessible from your development container via the hostname `localstack`.
16
+
17
+ **Architecture:**
18
+
19
+ - Edge API endpoint: `http://localstack:4566` (all services)
20
+ - S3 endpoint: `http://localstack:4571` (S3-specific)
21
+ - Services run inside LocalStack container
22
+ - Data persisted to Docker volume
23
+
24
+ ## Configuration
25
+
26
+ ### Environment Variables
27
+
28
+ The overlay includes a `.env.example` file. Copy it to `.env` and customize:
29
+
30
+ ```bash
31
+ cd .devcontainer
32
+ cp .env.example .env
33
+ ```
34
+
35
+ **Default values (.env.example):**
36
+
37
+ ```bash
38
+ # LocalStack Configuration
39
+ LOCALSTACK_VERSION=latest
40
+ LOCALSTACK_SERVICES=s3,sqs,sns,dynamodb,lambda,cloudformation
41
+ LOCALSTACK_DEBUG=0
42
+ LOCALSTACK_EDGE_PORT=4566
43
+ LOCALSTACK_S3_PORT=4571
44
+ ```
45
+
46
+ ### Available Services
47
+
48
+ LocalStack supports many AWS services. Common ones include:
49
+
50
+ - **Storage**: S3, EFS
51
+ - **Databases**: DynamoDB, RDS, Redshift
52
+ - **Messaging**: SQS, SNS, Kinesis
53
+ - **Compute**: Lambda, ECS, Batch
54
+ - **Infrastructure**: CloudFormation, CloudWatch
55
+
56
+ Set `LOCALSTACK_SERVICES` to enable specific services or use `LOCALSTACK_SERVICES=` (empty) to enable all.
57
+
58
+ ### Port Configuration
59
+
60
+ The default ports (4566, 4571) can be changed via the `--port-offset` option when initializing the devcontainer:
61
+
62
+ ```bash
63
+ npm run init -- --port-offset 100 --stack compose --cloud localstack
64
+ # LocalStack Edge will be on port 4666, S3 on port 4671
65
+ ```
66
+
67
+ ## Common Commands
68
+
69
+ ### AWS CLI Usage
70
+
71
+ The `aws-cli` overlay integrates seamlessly with LocalStack:
72
+
73
+ ```bash
74
+ # AWS CLI automatically uses LocalStack endpoints via AWS_ENDPOINT_URL
75
+ aws s3 ls
76
+ aws s3 mb s3://my-bucket
77
+ aws s3 cp myfile.txt s3://my-bucket/
78
+
79
+ # DynamoDB
80
+ aws dynamodb list-tables
81
+ aws dynamodb create-table --table-name MyTable \
82
+ --attribute-definitions AttributeName=id,AttributeType=S \
83
+ --key-schema AttributeName=id,KeyType=HASH \
84
+ --billing-mode PAY_PER_REQUEST
85
+
86
+ # SQS
87
+ aws sqs list-queues
88
+ aws sqs create-queue --queue-name my-queue
89
+ aws sqs send-message --queue-url http://localstack:4566/000000000000/my-queue \
90
+ --message-body "Hello LocalStack"
91
+
92
+ # Lambda
93
+ aws lambda list-functions
94
+ ```
95
+
96
+ ### Health Check
97
+
98
+ ```bash
99
+ # Check LocalStack health
100
+ curl http://localstack:4566/_localstack/health
101
+
102
+ # Check specific service
103
+ curl http://localstack:4566/_localstack/health | jq '.services.s3'
104
+ ```
105
+
106
+ ### Direct API Calls
107
+
108
+ ```bash
109
+ # S3 via REST API
110
+ curl http://localstack:4566/my-bucket
111
+
112
+ # List buckets
113
+ aws --endpoint-url=http://localstack:4566 s3 ls
114
+ ```
115
+
116
+ ## Use Cases
117
+
118
+ - **Cloud development without AWS account** - Develop and test AWS-based applications locally
119
+ - **Integration testing** - Test cloud integrations without external dependencies
120
+ - **Learning AWS services** - Experiment with AWS APIs without cost
121
+ - **CI/CD pipelines** - Run AWS-dependent tests in CI without credentials
122
+ - **Event-driven architectures** - Test SQS, SNS, Lambda workflows locally
123
+
124
+ **Integrates well with:**
125
+
126
+ - `aws-cli` - AWS command-line interface (suggested)
127
+ - `terraform` - Infrastructure as Code testing
128
+ - `pulumi` - Infrastructure as Code testing
129
+ - Node.js, Python, .NET - Application development with AWS SDK
130
+
131
+ ## Differences from Real AWS
132
+
133
+ LocalStack aims for high fidelity but has some differences:
134
+
135
+ - **Authentication** - Uses test credentials (no real IAM)
136
+ - **Performance** - May be faster or slower than real AWS
137
+ - **Feature parity** - Not all AWS features supported
138
+ - **Behavior** - Some edge cases may differ
139
+
140
+ For production deployments, always test on real AWS.
141
+
142
+ ## Troubleshooting
143
+
144
+ ### Service Not Ready
145
+
146
+ If LocalStack takes time to start:
147
+
148
+ ```bash
149
+ # Check logs
150
+ docker-compose logs localstack
151
+
152
+ # Wait for health check
153
+ curl http://localstack:4566/_localstack/health
154
+ ```
155
+
156
+ ### Connection Refused
157
+
158
+ Ensure the service is running:
159
+
160
+ ```bash
161
+ # Check service status
162
+ docker-compose ps localstack
163
+
164
+ # Restart if needed
165
+ docker-compose restart localstack
166
+ ```
167
+
168
+ ### Services Not Available
169
+
170
+ Enable specific services in `.env`:
171
+
172
+ ```bash
173
+ LOCALSTACK_SERVICES=s3,dynamodb,sqs,sns,lambda
174
+ ```
175
+
176
+ ## References
177
+
178
+ - [LocalStack Documentation](https://docs.localstack.cloud/)
179
+ - [LocalStack GitHub](https://github.com/localstack/localstack)
180
+ - [Supported AWS Services](https://docs.localstack.cloud/user-guide/aws/feature-coverage/)
181
+ - [AWS CLI with LocalStack](https://docs.localstack.cloud/user-guide/integrations/aws-cli/)
182
+
183
+ **Related Overlays:**
184
+
185
+ - `aws-cli` - AWS command-line interface
186
+ - `terraform` - Infrastructure as Code
187
+ - `pulumi` - Infrastructure as Code
188
+ - `nodejs`, `python`, `dotnet` - Application development
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "runServices": ["localstack"],
4
+ "forwardPorts": [4566, 4571],
5
+ "portsAttributes": {
6
+ "4566": {
7
+ "label": "LocalStack Edge",
8
+ "onAutoForward": "notify"
9
+ },
10
+ "4571": {
11
+ "label": "LocalStack S3",
12
+ "onAutoForward": "ignore"
13
+ }
14
+ },
15
+ "remoteEnv": {
16
+ "AWS_ENDPOINT_URL": "http://localstack:4566",
17
+ "AWS_ACCESS_KEY_ID": "test",
18
+ "AWS_SECRET_ACCESS_KEY": "test",
19
+ "AWS_DEFAULT_REGION": "us-east-1"
20
+ }
21
+ }
@@ -0,0 +1,25 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ localstack:
5
+ image: localstack/localstack:${LOCALSTACK_VERSION:-latest}
6
+ restart: unless-stopped
7
+ volumes:
8
+ - localstack-data:/var/lib/localstack
9
+ - /var/run/docker.sock:/var/run/docker.sock
10
+ environment:
11
+ SERVICES: ${LOCALSTACK_SERVICES:-s3,sqs,sns,dynamodb,lambda,cloudformation}
12
+ DEBUG: ${LOCALSTACK_DEBUG:-0}
13
+ DATA_DIR: /var/lib/localstack
14
+ DOCKER_HOST: unix:///var/run/docker.sock
15
+ ports:
16
+ - '${LOCALSTACK_EDGE_PORT:-4566}:4566'
17
+ - '${LOCALSTACK_S3_PORT:-4571}:4571'
18
+ networks:
19
+ - devnet
20
+
21
+ volumes:
22
+ localstack-data:
23
+
24
+ networks:
25
+ devnet:
@@ -0,0 +1,18 @@
1
+ id: localstack
2
+ name: LocalStack
3
+ description: Local AWS cloud stack for development and testing
4
+ category: cloud
5
+ supports:
6
+ - compose
7
+ requires: []
8
+ suggests:
9
+ - aws-cli
10
+ conflicts: []
11
+ tags:
12
+ - cloud
13
+ - aws
14
+ - testing
15
+ - localstack
16
+ ports:
17
+ - 4566
18
+ - 4571