diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..bdc3f68 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +{ + "name": "Go Dev Container", + "build": { + "context": "..", + "dockerfile": "../dev/docker/devcontainer.Dockerfile" + }, + "remoteEnv": { + "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}", + "HOST_DOCKER_DEV_FOLDER": "${localWorkspaceFolder}/dev/docker" + }, + "customizations": { + "vscode": { + "settings": { + "go.gopath": "/go", + "go.useLanguageServer": true + }, + "extensions": [ + "golang.go", + "ms-azuretools.vscode-docker" + ] + } + }, + "postCreateCommand": "go mod tidy", + "forwardPorts": [], + "remoteUser": "vscode", + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/common-utils:2": { + "username": "vscode", + "installZsh": true + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "moby": false + } + } +} diff --git a/dev/docker/devcontainer.Dockerfile b/dev/docker/devcontainer.Dockerfile new file mode 100644 index 0000000..2497203 --- /dev/null +++ b/dev/docker/devcontainer.Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.25 + +# Install golangci-lint +RUN curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.6 + +# Install buf CLI +RUN go install github.com/bufbuild/buf/cmd/buf@latest + +# Add shellcheck and jq +RUN apt-get update && apt-get install -y \ + shellcheck \ + jq