diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2211806..b7156c4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -42,6 +42,7 @@ jobs: S3_ACCESS_KEY=${{ secrets.S3_ACCESS_KEY }} S3_SECRET_KEY=${{ secrets.S3_SECRET_KEY }} S3_BUCKET=${{ secrets.S3_BUCKET }} + API_URL=${{ secrets.API_URL }} tags: | eatda/api-server:latest @@ -73,7 +74,7 @@ jobs: sudo docker rm - f $(docker ps -qa) sudo docker pull eatda/api-server:latest sudo docker stop $(sudo docker ps -aq) - sudo docker run -p 8080:8080 -d eatda/api-server:latest --name api-server + sudo docker run -p 80:8080 -d eatda/api-server:latest --name api-server - name: Remove IP FROM security group run: | diff --git a/Dockerfile b/Dockerfile index ceec6d1..97f1684 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ ARG DB_PASSWORD ARG S3_ACCESS_KEY ARG S3_SECRET_KEY ARG S3_BUCKET +ARG API_URL COPY ${JAR_FILE} app.jar @@ -21,5 +22,6 @@ ENV DB_PASSWORD=${DB_PASSWORD} ENV S3_ACCESS_KEY=${S3_ACCESS_KEY} ENV S3_SECRET_KEY=${S3_SECRET_KEY} ENV S3_BUCKET=${S3_BUCKET} +ENV API_URL=${API_URL} ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=${PROFILE}", "-Djava.security.egd=file:/dev/./urandom", "/app.jar"] diff --git a/gradle.properties b/gradle.properties index 9ca4c36..df3100a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ ### Application version ### -applicationVersion=0.1.8-RELEASE +applicationVersion=0.1.13-RELEASE ### Project configs ### projectGroup="com.mjucow" diff --git a/src/main/kotlin/com/mjucow/eatda/common/config/SwaggerConfig.kt b/src/main/kotlin/com/mjucow/eatda/common/config/SwaggerConfig.kt index ba6856e..fd76322 100644 --- a/src/main/kotlin/com/mjucow/eatda/common/config/SwaggerConfig.kt +++ b/src/main/kotlin/com/mjucow/eatda/common/config/SwaggerConfig.kt @@ -3,18 +3,24 @@ package com.mjucow.eatda.common.config import io.swagger.v3.oas.models.Components import io.swagger.v3.oas.models.OpenAPI import io.swagger.v3.oas.models.info.Info +import io.swagger.v3.oas.models.servers.Server +import org.springframework.beans.factory.annotation.Value import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @Configuration -class SwaggerConfig { +class SwaggerConfig( + @Value("\${swagger.api-url:http://localhost:8080}") + val apiUrl: String, +) { @Bean fun swaggerApi(): OpenAPI = OpenAPI() .components(Components()) + .servers(listOf(Server().apply { url = apiUrl })) .info( Info() .title("Eatda API Documentation") .description("Eatda(잇다) 서비스의 API 명세서입니다.") - .version("0.1.8") + .version("0.1.13") ) } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1b116f7..352141f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -32,6 +32,9 @@ springdoc: groups: enabled: true +swagger: + api-url: http://localhost:8080 + --- spring: @@ -107,3 +110,6 @@ aws: access-key: ${S3_ACCESS_KEY} secret-key: ${S3_SECRET_KEY} bucket: ${S3_BUCKET} + +swagger: + api-url: ${API_URL}