diff options
Diffstat (limited to 'debug')
-rw-r--r-- | debug/docker-compose-debug.yaml | 26 | ||||
-rw-r--r-- | debug/dockerfile-debug | 14 |
2 files changed, 40 insertions, 0 deletions
diff --git a/debug/docker-compose-debug.yaml b/debug/docker-compose-debug.yaml new file mode 100644 index 0000000..fe81fc7 --- /dev/null +++ b/debug/docker-compose-debug.yaml @@ -0,0 +1,26 @@ +services: + db: + build: + context: . + dockerfile: Dockerfile.postgres + ports: + - 5432:5432 + environment: + - POSTGRES_PASSWORD=secret + volumes: + - dbasik_data:/var/lib/postgresql/data + - ./migrations:/dbasik + app: + build: + context: . + dockerfile: Dockerfile + # volumes: + # - .:/app + restart: "unless-stopped" + command: "/dlv --listen=:2345 --headless=true --log=true --log-output=debugger,debuglineerr,gdbwire,lldbout,rpc --accept-multiclient --api-version=2 exec ./app" + ports: + - 2345:2345 + depends_on: + - db +volumes: + dbasik_data: diff --git a/debug/dockerfile-debug b/debug/dockerfile-debug new file mode 100644 index 0000000..296ab31 --- /dev/null +++ b/debug/dockerfile-debug @@ -0,0 +1,14 @@ +FROM golang:alpine as build + +WORKDIR / + +COPY . . + +RUN CGO_ENABLED=0 go install github.com/go-delve/delve/cmd/dlv@latest +#RUN CGO_ENABLED=0 go get -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv +RUN CGO_ENABLED=0 go build -gcflags "all=-N -l" -o ./app ./cmd/dbasik-api + +FROM scratch +COPY --from=build /go/bin/dlv /dlv +COPY --from=build /app /app +CMD ["/dlv"] |