diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8fb0045e..6e8033e5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,8 +7,20 @@ }, "runArgs": ["--device=/dev/snd"], "containerEnv": { - "ALSA_CARD": "0" + "ALSA_CARD": "0", + "CGO_ENABLED": "1", + "CGO_CFLAGS": "-I /root/src/tensorflow" }, - "postCreateCommand": "apt-get update && apt-get install -y ca-certificates libasound2 ffmpeg sox && apt-get clean && go install github.com/cosmtrek/air@latest", - "postAttachCommand": "make dev_server" + "postCreateCommand": ".devcontainer/postCreateCommand.sh", + "postAttachCommand": "make dev_server", + "customizations": { + "vscode": { + "extensions": [ + "golang.go" + ] + } + }, + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {} + } } diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 00000000..d9fd0c28 --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Install required apt dependencies +apt-get update +apt-get install -y ca-certificates libasound2 ffmpeg sox +apt-get install -y nano vim +apt-get clean + +# Install air to support live reloading of server on code changes +go install github.com/cosmtrek/air@latest + +# Install golangci-lint to allow running of linting locally +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.57.2