diff --git a/guac/dev-setup.md b/guac/dev-setup.md index 83358ad..8b0d7d8 100644 --- a/guac/dev-setup.md +++ b/guac/dev-setup.md @@ -9,6 +9,56 @@ nav_order: 6 # Development environment setup +## Try GUAC with a dev container + +A [development container](https://containers.dev/) is a quick way to try GUAC +without installing its Go build tools locally. The GUAC repository includes a +[`.devcontainer/devcontainer.json`](https://github.com/guacsec/guac/blob/main/.devcontainer/devcontainer.json) +configuration that downloads a published GUAC image and starts the services +using Docker Compose. + +Choose either of these environments: + +- **GitHub Codespaces:** Open the + [GUAC repository](https://github.com/guacsec/guac), select **Code**, + **Codespaces**, then **Create codespace on main**. +- **VS Code locally:** Install [Docker](https://docs.docker.com/get-docker/) and + the + [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). + Clone `https://github.com/guacsec/guac.git`, open the repository in VS Code, + and select **Dev Containers: Reopen in Container** from the Command Palette. + +The first startup pulls the GUAC release image. On each container start, its +`postStartCommand` launches the in-memory backend using `docker-compose.yml` and +`container_files/mem.yaml`. Wait for the terminal message `GUAC is ready.` + +Open the forwarded **8080** port to access the GraphQL playground. The REST API +is exposed on port **8081**, and you can check its health at +`http://localhost:8081/healthz` from inside the dev container (or through the +forwarded port). + +From a terminal in the GUAC repository, you can manage the services: + +```bash +# Show service status +docker compose -f docker-compose.yml -f container_files/mem.yaml ps + +# Follow logs when debugging startup +docker compose -f docker-compose.yml -f container_files/mem.yaml logs -f + +# Stop the services when you are done +docker compose -f docker-compose.yml -f container_files/mem.yaml down +``` + +The default backend is in memory, so it is intended for experimentation, not +durable storage. For a PostgreSQL-backed setup, replace +`container_files/mem.yaml` with `container_files/ent.yaml` in the devcontainer's +`postStartCommand` before reopening the container. See the [GraphQL +guide]({{ site.baseurl }}{% link guac/guac-graphql.md %}) for query and +ingestion examples. + +## Install tools for manual development + ## Ensure you have the following tools installed in your environment - [Docker](https://docs.docker.com/get-docker/)