Repository navigation
Expand file tree
/
Copy pathdevcontainer.json
More file actions
74 lines (66 loc) · 2.67 KB
/
Copy pathdevcontainer.json
File metadata and controls
74 lines (66 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright 2026 The GUAC Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Dev Container configuration for trialing GUAC.
//
// Works with GitHub Codespaces (cloud), the VS Code Dev Containers
// extension (local), JetBrains Gateway, and DevPod. On container
// create it pulls the published GUAC release image; on every start
// it brings up the full service stack with the in-memory GraphQL
// backend via docker compose. The GraphQL playground previews
// automatically on port 8080 and the REST API is on 8081.
//
// To use the persistent ent/PostgreSQL backend instead, swap
// container_files/mem.yaml for container_files/ent.yaml in the
// postStartCommand below.
//
// See https://docs.guac.sh/ for ingestion and query examples.
{
"name": "GUAC",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/common-utils:2": {}
},
"containerEnv": {
"GUAC_IMAGE": "ghcr.io/guacsec/guac:v1.1.0",
"GUAC_API_PORT": "8080"
},
"onCreateCommand": "docker pull $GUAC_IMAGE",
"postStartCommand": "docker compose -f docker-compose.yml -f container_files/mem.yaml up -d && bash -c 'c=0; until curl --silent --head --fail http://localhost:8080 >/dev/null; do if [ $c -ge 60 ]; then echo \"GUAC did not become ready in time\"; docker compose logs --tail=100; exit 1; fi; sleep 2; c=$((c+1)); done; echo; echo \"GUAC is ready.\"; echo \" - GraphQL playground: port 8080 (auto-previewed)\"; echo \" - REST API: port 8081 (e.g. /healthz)\"; echo \" - Tail logs: docker compose logs -f\"; echo \" - Stop: docker compose down\"'",
"forwardPorts": [8080, 8081],
"portsAttributes": {
"8080": {
"label": "GUAC GraphQL",
"onAutoForward": "openPreview"
},
"8081": {
"label": "GUAC REST API",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "silent"
},
"customizations": {
"vscode": {
"extensions": [
"graphql.vscode-graphql",
"graphql.vscode-graphql-syntax",
"ms-azuretools.vscode-docker",
"golang.go"
]
}
}
}