chore: add dlv for debugging in dev workflow

This commit is contained in:
Stavros
2025-07-11 17:15:32 +03:00
parent f73eb9571f
commit 10d1b48505
5 changed files with 19 additions and 5 deletions

3
.gitignore vendored
View File

@@ -13,9 +13,6 @@ users.txt
# secret test file
secret*
# vscode
.vscode
# apple stuff
.DS_Store

15
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "/tinyauth",
"port": 4000,
"host": "127.0.0.1",
"debugAdapter": "legacy"
}
]
}

View File

@@ -13,6 +13,7 @@ COPY ./main.go ./
COPY ./air.toml ./
RUN go install github.com/air-verse/air@v1.61.7
RUN go install github.com/go-delve/delve/cmd/dlv@v1.25.0
EXPOSE 3000

View File

@@ -3,8 +3,8 @@ tmp_dir = "tmp"
[build]
pre_cmd = ["mkdir -p internal/assets/dist", "echo 'backend running' > internal/assets/dist/index.html"]
cmd = "CGO_ENABLED=0 go build -o ./tmp/tinyauth ."
bin = "tmp/tinyauth"
cmd = "CGO_ENABLED=0 go build -gcflags=\"all=-N -l\" -o ./tinyauth ."
bin = "/go/bin/dlv --listen :4000 --headless=true --api-version=2 --accept-multiclient --log=true exec ./tinyauth"
include_ext = ["go"]
exclude_dir = ["internal/assets/dist"]
exclude_regex = [".*_test\\.go"]

View File

@@ -42,6 +42,7 @@ services:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 3000:3000
- 4000:4000
labels:
traefik.enable: true
traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth-backend:3000/api/auth/traefik