-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to connect when running core and database in separate container ? #24
Comments
Please check it your docker-compose file entrypoint with delve execution(listen 4000 port):
|
sorry i posted the wrong docker file, here is the one with dlv debug implemented
|
Sorry for the late reply, I did not reproduce it situation(split up core (server logic) and database into 2 different container instead of using compose to group them together.) here is my dockerfile FROM maplebreak/nakama-pluginbuilder:3.20.0-arm AS go-builder
ENV GO111MODULE on
ENV CGO_ENABLED 1
ENV GOOS linux
ENV GOARCH arm64
WORKDIR /backend
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y --no-install-recommends gcc libc6-dev
RUN go install github.com/go-delve/delve/cmd/dlv@latest
COPY local.yml .
COPY go.mod .
COPY *.go ./
COPY vendor/ vendor/
COPY api/ api/
# Go runtime plugin using the --gcflags "all=-N -l" flag which effectively disables optimizations in the resulting plugin file.
RUN go build --trimpath --gcflags "all=-N -l" --mod=vendor --buildmode=plugin -o ./backend.so
# Using the nakama-dsym image rather than the standard nakama image.
# This is an image that provides us with a Nakama binary with optimizations disabled, suitable for running with dlv just like our plugin.
FROM maplebreak/nakama-dsym:3.20.0-arm
COPY --from=go-builder /go/bin/dlv /nakama
COPY --from=go-builder /backend/backend.so /nakama/data/modules/
COPY --from=go-builder /backend/local.yml /nakama/data/
COPY local.yml /nakama/data/
ENTRYPOINT ["/bin/sh", "-ecx", "/nakama/nakama migrate up --database.address postgres:localdb@172.16.0.96:5432/nakama && /nakama/dlv --log --log-output=debugger --accept-multiclient --listen=:4000 --headless=true --api-version=2 exec /nakama/nakama -- --config /nakama/data/local.yml --database.address postgres:localdb@172.16.0.96:5432/nakama"] |
hmm ok, thank you very much for taking time helping me ! |
as title stated, in order to deploy the server on to other cloud platform, i have split up my core (server logic) and database into 2 different container instead of using compose to group them together.
and when doing that, the debugger seems failed to connect with the following error message.
2024-04-13T15:47:39Z error layer=rpc writing response:write tcp 172.17.0.3:4000->172.17.0.1:56738: use of closed network connection
my docker file
my goland run config
the database part should be fine because i have a Docker_release file which build my server without dlv and it can connect to database and i can enter the admin portal as usual.
Can you tell what went wrong with the debugging ?
Thanks in advance
The text was updated successfully, but these errors were encountered: