-
Notifications
You must be signed in to change notification settings - Fork 927
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added debug config for docker and local, to make it easier to debug y…
…agpdb (#1630) Co-authored-by: Ashish Jhanwar <[email protected]>
- Loading branch information
1 parent
7098ec2
commit b27cd29
Showing
4 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ cmd/shardorchestrator/shardorchestrator | |
*.agent | ||
*.exe | ||
cmd/shardorchestrator/capturepanics | ||
__debug_bin* | ||
app.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "YAGPDB Docker Debug", | ||
"type": "go", | ||
"request": "attach", | ||
"port": 4000, | ||
"host": "127.0.0.1", | ||
"cwd": "${workspaceRoot}", | ||
"showLog": true, | ||
"mode": "remote", | ||
"remotePath": "/app/yagpdb/", | ||
"substitutePath": [ | ||
{ "from": "${workspaceFolder}", "to": "/app/yagpdb" }, | ||
] | ||
}, { | ||
"name": "YAGPDB Local Debug", | ||
"type":"go", | ||
"request": "launch", | ||
"mode": "debug", | ||
"envFile": "${workspaceFolder}/app.env", | ||
"program": "${workspaceFolder}/cmd/yagpdb/main.go", | ||
"output": "${workspaceFolder}/cmd/yagpdb/yagpdb", | ||
"args": ["-all","https=false"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM golang:1.22.2-alpine | ||
# Dependencies: ca-certificates for client TLS, tzdata for timezone and ffmpeg for soundboard support | ||
RUN apk --no-cache add ca-certificates ffmpeg tzdata | ||
RUN CGO_ENABLED=0 go install -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv@latest | ||
|
||
WORKDIR /app/yagpdb | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
WORKDIR /app/yagpdb/cmd/yagpdb | ||
|
||
VOLUME ["/app/soundboard", "/app/cert"] | ||
EXPOSE 5000 4000 | ||
EXPOSE 5100-5999 | ||
CMD [ "/go/bin/dlv", "--listen=:4000", "--headless=true", "--log=true", "--accept-multiclient", "--api-version=2", "debug", "--continue", "--output=yagpdb", "--", "-all", "-https=false" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
version: '3' | ||
|
||
volumes: | ||
db: | ||
redis: | ||
cert_cache: | ||
soundboard: | ||
|
||
networks: | ||
default: | ||
|
||
services: | ||
app: | ||
build: | ||
# We change context so that we can copy the local repo in during | ||
# development | ||
context: ../ | ||
dockerfile: yagpdb_docker/Dockerfile.debug | ||
restart: unless-stopped | ||
depends_on: | ||
- redis | ||
- db | ||
networks: | ||
- default | ||
volumes: | ||
- cert_cache:/app/cert | ||
- soundboard:/app/soundboard | ||
- ..:/app/yagpdb | ||
ports: | ||
- '5000:5000' | ||
- '4000:4000' | ||
- '5100-5999:5100-5999' | ||
env_file: | ||
- app.env | ||
security_opt: | ||
- "seccomp:unconfined" | ||
|
||
redis: | ||
image: redis | ||
restart: unless-stopped | ||
networks: | ||
- default | ||
volumes: | ||
- redis:/data | ||
|
||
db: | ||
image: postgres:11 | ||
restart: unless-stopped | ||
volumes: | ||
- db:/var/lib/postgresql/data | ||
networks: | ||
- default | ||
env_file: | ||
- db.env |