diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bcd67f3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM eclipse-temurin:21-jdk AS builder +WORKDIR /app + +COPY gradlew . +COPY gradle gradle +COPY build.gradle settings.gradle ./ +COPY src src + +RUN chmod +x ./gradlew +RUN ./gradlew bootJar --no-daemon + +FROM eclipse-temurin:21-jre +WORKDIR /app + +COPY --from=builder /app/build/libs/*.jar app.jar + +EXPOSE 19000 + +ENTRYPOINT ["java", "-jar", "/app/app.jar"] \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index a239fa0..4907e98 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'gateway' +rootProject.name = 'api-gateway' diff --git a/src/main/resources/application-docker.yml b/src/main/resources/application-docker.yml new file mode 100644 index 0000000..73ed6dc --- /dev/null +++ b/src/main/resources/application-docker.yml @@ -0,0 +1,4 @@ +eureka: + client: + service-url: + defaultZone: http://eureka-server:8761/eureka/ \ No newline at end of file diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index da33d1a..aa7c90c 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -1,5 +1,3 @@ - - eureka: client: service-url: