Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
kotlin("plugin.spring") version "1.9.25"
id("org.springframework.boot") version "3.4.3"
id("io.spring.dependency-management") version "1.1.7"
id("com.google.cloud.tools.jib") version "3.4.5"
}

group = "com.depromeet"
Expand Down Expand Up @@ -44,6 +45,32 @@ kotlin {
}
}

jib {
val imageName: String = project.name
val imageTag: String = System.getenv("GITHUB_SHA") ?: "dev"
val dockerUser: String = System.getenv("DOCKER_USER") ?: "ddingmin00"

from {
image = "amazoncorretto:21-alpine3.19-jdk"
platforms {
platform {
architecture = "arm64"
os = "linux"
}
}
}
to {
image = "$dockerUser/$imageName"
tags = setOf("latest", imageTag)
}
container {
creationTime = "USE_CURRENT_TIMESTAMP"
ports = listOf("8080")
environment = mapOf("timezone" to "Asia/Seoul")
user = "1000:1000"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class SwaggerConfig {
.servers(
listOf(
Server()
.description("API 서버 URL")
.description("API DEV 서버 URL")
.url("https://dev-makers.ddmz.org"),
Server()
.description("API LOCAL 서버 URL")
.url("http://localhost:8080"),
),
)
Expand Down
7 changes: 7 additions & 0 deletions src/main/kotlin/com/depromeet/makers/config/WebConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.springframework.context.annotation.Configuration
import org.springframework.web.client.RestClient
import org.springframework.web.client.support.RestClientAdapter
import org.springframework.web.service.invoker.HttpServiceProxyFactory
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration
Expand All @@ -33,4 +34,10 @@ class WebConfig : WebMvcConfigurer {
.build()
.createClient(KakaoAuthClient::class.java)
}

override fun addCorsMappings(registry: CorsRegistry) {
registry.addMapping("/**")
.allowedMethods("*")
.allowedOrigins("*")
}
}