After docker-compose up -d --build, the server service is in a running state but getting the above error. I tried to build and run the code inside the container, it is running as expected. But If I start using docker-compose up, getting the above error.
Dockerfile stage
FROM dev as debug
# install debugging tools
RUN go get github.com/go-delve/delve/cmd/dlv
RUN go get github.com/cespare/reflex
# install any project dependencies
RUN go get -d -v ./...
CMD reflex -R "__debug_bin" -s -- sh -c "dlv debug --headless --continue --accept-multiclient --listen :40000 --api-version=2 --log ./src/"
docker-compose.yml
version: "3.8"
services:
server:
image: sample-service:debug
build:
context: .
dockerfile: src/Dockerfile
target: debug
args:
NETRC_LOCAL: ${NETRC_LOCAL}
security_opt:
- seccomp:unconfined
ports:
- 8080:8080
- 40000:40000
env_file: .env
volumes:
- .:/test
depends_on:
- cassandra
- kafka