Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ object FileContent {
${getEnvString(env)}
""".trimIndent()

fun getH2DBDockerFileContent(version: String, port: Int, env: Map<String, String>): String =
"""
FROM oscarfonts/h2:${version}
EXPOSE $port
${getEnvString(env)}
""".trimIndent()

fun getImageVersionShellScriptContent(imageName: String, minVersion: String): String =
"""
#!/bin/bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ enum class ApplicationType {
NEST_JS,
MYSQL,
MARIA_DB,
REDIS
REDIS,
H2_DB
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class CreateDockerFileServiceImpl(

ApplicationType.NEST_JS ->
FileContent.getNestJsDockerFileContent(version, application.port, applicationEnv)

ApplicationType.H2_DB ->
FileContent.getH2DBDockerFileContent(version, application.port, applicationEnv)
}
try {
if (!file.exists())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class GetApplicationVersionServiceImpl(
ApplicationType.MARIA_DB -> "mariadb" to "10"
ApplicationType.MYSQL -> "mysql" to "8"
ApplicationType.REDIS -> "redis" to "6"
ApplicationType.H2_DB -> "oscarfonts/h2" to "0"
}
val getVersionScript = FileContent.getImageVersionShellScriptContent(baseImageName, minVersion)
return commandPort.executeShellCommandWithResult(getVersionScript)
Expand Down