Spring & Spring Boot/Spring Boot
[Spring Boot] Cloud Native Java - 애플리케이션 마이그레이션 (1)
Serina_Heo
2022. 9. 29. 13:02
애플리케이션 환경 마이그레이션
pacakge demo;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/hi")
public class DemoApplication extends HttpServlet {
protected void doGet(
HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
response.getWriter().print("<html><body><h3>Hello Cloud</h3></body></html>");
}
}
이 서블릿 애플리케이션을 실행하려면 아래와 같이 애플리케이션의 manifest.yml 파일에 웹스피어 리버티 빌드팩을 지정해줘야한다.
---
application:
- name: wsl-demo
memory: 1024M
buildpack: https://github.com/cloudfoundry/ibm-websphere-liberty-builcpack.git
instances: 1
host: wsl-demo-${random-word}
path: target/buildpacks.war
env:
SPRING_PROFILES_ACTIVE: cloud
DEBUG: "true"
debug: "true"
IBM_JVM_LICENSE: L-JWOD-9sYNCP
IBM_LIBRARY_LICENSE: L-MCA0-9SYMVC
[Reference] Cloud Native Java - Josh Long, Kenny Bastani, 책만