본문 바로가기
개발서적

스프링 인 액션 - (6)

by 공부 안하고 싶은 사람 2022. 8. 17.
반응형

Part 5. 스프링 배포

chapter 16 스프링 부트 액추에이터 사용하기

chapter 17 스프링 관리하기

https://code-resting.tistory.com/54

 

Spring Boot Admin / Spring Boot Actuator

Spring Boot Actuator를 통해 어플리케이션의 JVM, JMX, 메모리, GC 등 health정보를 가져올 수 있다. (http://localhost:8080/actuator 호출 시 HATEOAS로 정보 가져올 수 있다.) 여기에 Spring Boot Admin을 이..

code-resting.tistory.com

 

 


chapter 18 JMX로 스프링 모니터링하기

생략

 


chapter 19 스프링 배포하기

배포옵션

  • IDE에서 실행
  • springboot:run, gardle:bootRun 사용
  • jar 실행 -> 클라우드
  • war 실행 -> 자바 애플리케이션 서버(WAS 등)에 배포

 

war 생략

 

 

JAR 배포

빌드
$ mvnw package
​
$ gradle build

 

도커 컨테이너에서 스프링 부트 실행

Spotify 플러그인으로 컨테이너 생성

<build>
  <plugins>
  ...
 <plugin>
  <groupId>com.spotify</groupId>
   <artifactId>dockerfile-maven-plugin</artifactId>
   <version>1.4.3.</version>
   <configuration>
    <repository>
      ${docker.image.prefix}/${project.artifactId}
     </repository>
     <buildArgs>
      <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
     </buildArgs>
   </configuration>
 </plugin>
</plugins>
</build>
​
<properties>
  <docker.image.prefix>tacocloud</docker.image.prefix>
</properties>

Dockerfile

FROM openjdk:8-kdk-alpine
ENV SPRING_PROFILES_ACTIVE docker
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java", \
            ""]

 

728x90
반응형

'개발서적' 카테고리의 다른 글

스프링 인 액션 - (5)  (0) 2022.08.12
스프링 인 액션 - (4)  (0) 2022.08.11
스프링 인 액션 - (3)  (0) 2022.08.10
스프링 인 액션 - (2)  (0) 2022.08.10
스프링 인 액션 - (1)  (0) 2022.08.09

댓글