Hi guys... can you please help me to configure In...
# server
f
Hi guys... can you please help me to configure IntelliJ IDEA to debug Ktor into Docker (using docker plugin for ktor)? I get:
Error running 'jvm in docker' Unable to open debugger port (localhost:5005): java.net.ConnectException "Connection refused
Copy code
// build.gradle.kts
// 
// I have included:
//   "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
//   and 5005 port mapping 
//

application {
    mainClass.set("io.ktor.server.cio.EngineMain")

    val isDevelopment: Boolean = project.ext.has("development")

    applicationDefaultJvmArgs = listOf(
        "-Dio.ktor.development=$isDevelopment",
        "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
    )
}

ktor {
    docker {
        // setup port mapping for the container/service
        portMappings.set(listOf(
            io.ktor.plugin.features.DockerPortMapping(
                outsideDocker = 8080,
                insideDocker = 8080,
                io.ktor.plugin.features.DockerPortMappingProtocol.TCP
            ),
            io.ktor.plugin.features.DockerPortMapping(
                outsideDocker = 5005,
                insideDocker = 5005,
                io.ktor.plugin.features.DockerPortMappingProtocol.TCP
            ),
        ))


    }
}
Copy code
// application.yaml

ktor:
  development: true
  application:
    modules:
      - net.beoni.ktorunderalb.ApplicationKt.module
  deployment:
    port: 8080
    autoreload: true
IDEA Run Cofiguration (jvm remote)