Skip to content

Commit

Permalink
Merge pull request #111 from isZumpo/improve_devcontainer
Browse files Browse the repository at this point in the history
Improve devcontainer setup
  • Loading branch information
tphakala authored Apr 6, 2024
2 parents c5a92ee + 1ed2e68 commit 98ec6f4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
}
13 changes: 13 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 98ec6f4

Please sign in to comment.