From b136c8ac327e730fe4edba2c993b06f47caf788e Mon Sep 17 00:00:00 2001 From: songhaechan Date: Sat, 28 Oct 2023 20:37:33 +0900 Subject: [PATCH] dockerfile --- docker-compose.yml | 4 ---- dockerFile-was01 | 3 ++- dockerFile-was02 | 4 ++-- scouter/agent.java/conf/was01.conf | 12 ++++++++++++ scouter/agent.java/conf/was02.conf | 12 ++++++++++++ 5 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 scouter/agent.java/conf/was01.conf create mode 100644 scouter/agent.java/conf/was02.conf diff --git a/docker-compose.yml b/docker-compose.yml index ba1af4a..bf778ce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,15 +3,11 @@ services: spring_app1: container_name: Spring-Tomcat-1 image: haechansomg/simple-board:was01 - environment: - - JAVA_OPTS=-javaagent:/home/ubuntu/scouter/agent.java/scouter-agent-java-2.20.0.jar -Dscouter.config=/home/ubuntu/scouter/agent.java/conf/was01.conf -Dobj_name=WAS-01 ports: - 8080:8080 spring_app2: container_name: Spring-Tomcat-2 image: haechansomg/simple-board2:was02 - environment: - - JAVA_OPTS=-javaagent:/home/ubuntu/scouter/agent.java/scouter-agent-java-2.20.0.jar -Dscouter.config=/home/ubuntu/scouter/agent.java/conf/was02.conf -Dobj_name=WAS-02 ports: - 8081:8081 redis: diff --git a/dockerFile-was01 b/dockerFile-was01 index 63bba45..0da7489 100644 --- a/dockerFile-was01 +++ b/dockerFile-was01 @@ -3,4 +3,5 @@ FROM openjdk:17-jdk ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar COPY scouter/agent.java/scouter-agent-java-2.20.0.jar scouter-agent-java-2.20.0.jar -ENTRYPOINT ["java","-javaagent:scouter-agent-java-2.20.0.jar","-Duser.timezone=Asia/Seoul","-jar","app.jar"] +COPY scouter/agent.java/conf/was01.conf was01.conf +ENTRYPOINT ["java","-javaagent:scouter-agent-java-2.20.0.jar","-Dscouter.config=was01.conf","-Duser.timezone=Asia/Seoul","-jar","app.jar"] diff --git a/dockerFile-was02 b/dockerFile-was02 index d5bc8f5..ea1a611 100644 --- a/dockerFile-was02 +++ b/dockerFile-was02 @@ -3,5 +3,5 @@ FROM openjdk:17-jdk ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar COPY scouter/agent.java/scouter-agent-java-2.20.0.jar scouter-agent-java-2.20.0.jar - -ENTRYPOINT ["java","-javaagent:scouter-agent-java-2.20.0.jar","-Duser.timezone=Asia/Seoul","-jar","app.jar"] +COPY scouter/agent.java/conf/was02.conf was02.conf +ENTRYPOINT ["java","-javaagent:scouter-agent-java-2.20.0.jar","-Dscouter.config=was01.conf","-Duser.timezone=Asia/Seoul","-jar","app.jar"] diff --git a/scouter/agent.java/conf/was01.conf b/scouter/agent.java/conf/was01.conf new file mode 100644 index 0000000..062f0c0 --- /dev/null +++ b/scouter/agent.java/conf/was01.conf @@ -0,0 +1,12 @@ +### scouter java agent configuration sample +obj_name=WAS-01 +net_collector_ip=34.16.187.75 +net_collector_udp_port=6100 +net_collector_tcp_port=6100 +#hook_method_patterns=sample.mybiz.*Biz.*,sample.service.*Service.* +#trace_http_client_ip_header_key=X-Forwarded-For +#profile_spring_controller_method_parameter_enabled=false +#hook_exception_class_patterns=my.exception.TypedException +#profile_fullstack_hooked_exception_enabled=true +#hook_exception_handler_method_patterns=my.AbstractAPIController.fallbackHandler,my.ApiExceptionLoggingFilter.handleNotFoundErrorResponse +#hook_exception_hanlder_exclude_class_patterns=exception.BizException diff --git a/scouter/agent.java/conf/was02.conf b/scouter/agent.java/conf/was02.conf new file mode 100644 index 0000000..874657a --- /dev/null +++ b/scouter/agent.java/conf/was02.conf @@ -0,0 +1,12 @@ +### scouter java agent configuration sample +obj_name=WAS-02 +net_collector_ip=34.16.187.75 +net_collector_udp_port=6100 +net_collector_tcp_port=6100 +#hook_method_patterns=sample.mybiz.*Biz.*,sample.service.*Service.* +#trace_http_client_ip_header_key=X-Forwarded-For +#profile_spring_controller_method_parameter_enabled=false +#hook_exception_class_patterns=my.exception.TypedException +#profile_fullstack_hooked_exception_enabled=true +#hook_exception_handler_method_patterns=my.AbstractAPIController.fallbackHandler,my.ApiExceptionLoggingFilter.handleNotFoundErrorResponse +#hook_exception_hanlder_exclude_class_patterns=exception.BizException \ No newline at end of file