title: Delve debugging with hot reload
body: <p>My current development setup is a docker file that compiles the code on every save with <a href="https://github.com/githubnemo/CompileDaemon" rel="noreferrer">CompileDaemon</a>, and debug with <a href="https://github.com/go-delve/delve/cmd/dlv" rel="noreferrer">Delve</a>.</p>
  <p>Currently I get almost everything to work. The only problem is that the port is already in use when I try to start the debug again.</p>
  <p>Is their a better way to accomplish live reload with debug inside a docker container?</p>
  <p>Dockerfile:</p>
  <pre><code>FROM golang:latest
  
  RUN go get github.com/githubnemo/CompileDaemon &amp;&amp; \
    go get github.com/go-delve/delve/cmd/dlv  
  WORKDIR /app
  COPY go.* ./
  RUN go mod download
  
  COPY ./ ./
  
  EXPOSE 5000 2345
  # echo 1 is to block build command 
  ENTRYPOINT CompileDaemon --build=&quot;echo 1&quot; --command=&quot;dlv debug --headless --listen=:2345 --api-version=2 --accept-multiclient cmd/app/main.go&quot;
  </code></pre>