{"id":470673,"date":"2025-08-14T03:03:43","date_gmt":"2025-08-14T03:03:43","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=470673"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=470673","title":{"rendered":"<span>\u0414\u0435\u043f\u043b\u043e\u0438\u043c Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 Docker Compose \u0432 Timeweb Cloud \u0437\u0430 10 \u043c\u0438\u043d\u0443\u0442<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0434\u0435\u043f\u043b\u043e\u044f, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0438 \u043f\u0443\u0433\u0430\u044e\u0449\u0438\u043c. \u0414\u043e\u043a\u0435\u0440-\u043e\u0431\u0440\u0430\u0437\u044b, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, container registry, \u0430 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 Kubernetes \u2014 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u0430 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0433\u043e\u043b\u043e\u0432\u043d\u0430\u044f \u0431\u043e\u043b\u044c. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0448\u0438 \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u044b \u0438\u0437 Amplicode \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 Spring-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0430 \u043d\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u2014 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u043c \u0432 \u0432\u0438\u0434\u0435\u043e-\u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/6899ff591b1835abde509596\" data-style=\"\" id=\"6899ff591b1835abde509596\" width=\"\"><\/div>\n<blockquote>\n<p><a href=\"https:\/\/vkvideo.ru\/video-28839208_456239568?list=f544830cff0e96f63d\" rel=\"noopener noreferrer nofollow\"><strong>VK \u0412\u0438\u0434\u0435\u043e<\/strong><\/a> \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=lfGDHvepytk\" rel=\"noopener noreferrer nofollow\"><strong>YT<\/strong><\/a><\/p>\n<\/blockquote>\n<h2>\u276f \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 Spring Petclinic, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Spring Boot. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430: \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL \u0438 \u0431\u0440\u043e\u043a\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 Kafka. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0439\u0434\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c: \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 Docker Compose.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ac3\/294\/c5e\/ac3294c5e24f8ef4250bba34145bb730.png\" width=\"1600\" height=\"956\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/ac3\/294\/c5e\/ac3294c5e24f8ef4250bba34145bb730.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ac3\/294\/c5e\/ac3294c5e24f8ef4250bba34145bb730.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h2>\u276f \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u2014 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 docker-compose.yml:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/071\/90e\/fe3\/07190efe379eb274e470d1cb789768e3.png\" width=\"1600\" height=\"971\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/071\/90e\/fe3\/07190efe379eb274e470d1cb789768e3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/071\/90e\/fe3\/07190efe379eb274e470d1cb789768e3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0448\u0435 Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u044d\u043a\u0441\u043f\u043e\u0443\u0437\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u0440\u0442\u044b. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 IDE, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0434\u043b\u044f \u043d\u0438\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c\u0438 \u043e\u0442 Amplicode:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3ab\/bcc\/2af\/3abbcc2afa8b9e1ee65d6660f9eaec6a.gif\" width=\"2048\" height=\"1152\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3ab\/bcc\/2af\/3abbcc2afa8b9e1ee65d6660f9eaec6a.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3ab\/bcc\/2af\/3abbcc2afa8b9e1ee65d6660f9eaec6a.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>services:   spring-petclinic:     image: org.springframework.samples.spring-petclinic:latest     build:       context: ..\/..       dockerfile: existing-spring-boot-app-modification\/spring-petclinic-main\/Dockerfile       args:         DOCKER_BUILDKIT: 1     restart: \"no\"     ports:       - \"8080:8080\"     healthcheck:       test: wget --no-verbose --tries=1 --spider http:\/\/localhost:8080\/actuator\/health || exit 1       interval: 30s       timeout: 5s       start_period: 30s       retries: 5     labels:       amplicode.image: springboot   <\/code><\/pre>\n<pre><code class=\"xml\">FROM gradle:9.0.0 AS builder WORKDIR \/application COPY . . RUN --mount=type=cache,target=\/root\/.gradle gradle clean :org.springframework.samples.spring-petclinic:build -x test  FROM bellsoft\/liberica-openjre-alpine:23 AS layers WORKDIR \/application COPY --from=builder \/application\/existing-spring-boot-app-modification\/spring-petclinic-main\/build\/libs\/*.jar app.jar RUN java -Djarmode=layertools -jar app.jar extract  FROM bellsoft\/liberica-openjre-alpine:23 VOLUME \/tmp RUN adduser -S spring-user USER spring-user  WORKDIR \/application  COPY --from=layers \/application\/dependencies\/ .\/ COPY --from=layers \/application\/spring-boot-loader\/ .\/ COPY --from=layers \/application\/snapshot-dependencies\/ .\/ COPY --from=layers \/application\/application\/ .\/  ENV JAVA_RESERVED_CODE_CACHE_SIZE=\"240M\" ENV JAVA_MAX_DIRECT_MEMORY_SIZE=\"10M\" ENV JAVA_MAX_METASPACE_SIZE=\"179M\" ENV JAVA_XSS=\"1M\" ENV JAVA_XMX=\"345M\"  ENV JAVA_ERROR_FILE_OPTS=\"-XX:ErrorFile=\/tmp\/java_error.log\" ENV JAVA_HEAP_DUMP_OPTS=\"-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\/tmp\" ENV JAVA_ON_OUT_OF_MEMORY_OPTS=\"-XX:+CrashOnOutOfMemoryError\" ENV JAVA_NATIVE_MEMORY_TRACKING_OPTS=\"-XX:NativeMemoryTracking=summary -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMTStatistics\" ENV JAVA_GC_LOG_OPTS=\"-Xlog:gc*,safepoint:\/tmp\/gc.log::filecount=10,filesize=100M\" ENV JAVA_FLIGHT_RECORDING_OPTS=\"-XX:StartFlightRecording=disk=true,dumponexit=true,filename=\/tmp\/,maxsize=10g,maxage=24h\" ENV JAVA_JMX_REMOTE_OPTS=\"-Djava.rmi.server.hostname=127.0.0.1 \\    -Dcom.sun.management.jmxremote.authenticate=false \\    -Dcom.sun.management.jmxremote.ssl=false \\    -Dcom.sun.management.jmxremote.port=5005 \\    -Dcom.sun.management.jmxremote.rmi.port=5005\"  ENTRYPOINT java \\    -XX:ReservedCodeCacheSize=$JAVA_RESERVED_CODE_CACHE_SIZE \\    -XX:MaxDirectMemorySize=$JAVA_MAX_DIRECT_MEMORY_SIZE \\    -XX:MaxMetaspaceSize=$JAVA_MAX_METASPACE_SIZE \\    -Xss$JAVA_XSS \\    -Xmx$JAVA_XMX \\    $JAVA_HEAP_DUMP_OPTS \\    $JAVA_ON_OUT_OF_MEMORY_OPTS \\    $JAVA_ERROR_FILE_OPTS \\    $JAVA_NATIVE_MEMORY_TRACKING_OPTS \\    $JAVA_GC_LOG_OPTS \\    $JAVA_FLIGHT_RECORDING_OPTS \\    $JAVA_JMX_REMOTE_OPTS \\    org.springframework.boot.loader.JarLauncher <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f compose, \u043c\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 Dockerfile <a href=\"https:\/\/habr.com\/ru\/companies\/spring_aio\/articles\/901302\/\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043b\u0443\u0447\u0448\u0438\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u043c<\/a> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c Dockerfile \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/563\/02b\/2fa\/56302b2faf034e9501834556bafa7e23.png\" width=\"1600\" height=\"1375\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/563\/02b\/2fa\/56302b2faf034e9501834556bafa7e23.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/563\/02b\/2fa\/56302b2faf034e9501834556bafa7e23.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0418\u043b\u0438 \u0434\u0430\u0436\u0435 \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/049\/9aa\/808\/0499aa8080bbc726acd30b748e90a463.png\" width=\"1600\" height=\"1183\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/049\/9aa\/808\/0499aa8080bbc726acd30b748e90a463.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/049\/9aa\/808\/0499aa8080bbc726acd30b748e90a463.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Dockerfile \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 JVM, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0438 \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u043b\u043e \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.\u00a0<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6e1\/816\/786\/6e1816786a017f0cf658e7780907b94d.png\" width=\"1600\" height=\"1221\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/6e1\/816\/786\/6e1816786a017f0cf658e7780907b94d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6e1\/816\/786\/6e1816786a017f0cf658e7780907b94d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438: heap dump, GC-\u043b\u043e\u0433\u0438, Java Flight Recorder (JFR) \u0438 JMX. \u042d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c (<s>\u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 <\/s>\u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f).<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ec\/fc3\/9e0\/1ecfc39e0008d4fc5e717042accd4601.png\" width=\"1600\" height=\"1337\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/1ec\/fc3\/9e0\/1ecfc39e0008d4fc5e717042accd4601.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ec\/fc3\/9e0\/1ecfc39e0008d4fc5e717042accd4601.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p><strong><em>\u0412\u0430\u0436\u043d\u044b\u0439 \u043d\u044e\u0430\u043d\u0441:<\/em><\/strong><em> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \/tmp), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0447\u0438\u0449\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438\u043b\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u0414\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d-\u0441\u0440\u0435\u0434\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 volume \u0438\u043b\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0434\u0438\u0441\u043a.<\/em><\/p>\n<h2>\u276f \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 PostgreSQL \u0438 Kafka \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f Docker Compose<\/h2>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 docker-compose.yml \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b PostgreSQL \u0438 Kafka. \u0412 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d-\u0441\u0440\u0435\u0434\u0435 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u043e\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u044d\u0442\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430\u0440\u0443\u0436\u0443 \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u0438\u043c\u0435\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e00\/302\/d32\/e00302d32dc2f6625afbf596aa4a61cd.gif\" width=\"1138\" height=\"640\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e00\/302\/d32\/e00302d32dc2f6625afbf596aa4a61cd.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e00\/302\/d32\/e00302d32dc2f6625afbf596aa4a61cd.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>services:  postgres:    image: postgres:17.5    restart: \"no\"    volumes:      - postgres_data:\/var\/lib\/postgresql\/data    environment:      POSTGRES_USER: root      POSTGRES_PASSWORD: root      POSTGRES_DB: spring-petclinic    healthcheck:      test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB      interval: 10s      timeout: 5s      start_period: 10s      retries: 5  kafka:    image: confluentinc\/cp-kafka:8.0.0    restart: \"no\"    volumes:      - kafka_data:\/var\/lib\/kafka\/data    environment:      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT:\/\/kafka:29092,PLAINTEXT_HOST:\/\/localhost:9092      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,CONTROLLER:PLAINTEXT      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT      KAFKA_NODE_ID: 1      CLUSTER_ID: koa_uLJGTQe-qKkjpbagQg      KAFKA_PROCESS_ROLES: controller,broker      KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093      KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER      KAFKA_LISTENERS: PLAINTEXT:\/\/kafka:29092,PLAINTEXT_HOST:\/\/0.0.0.0:9092,CONTROLLER:\/\/kafka:9093    healthcheck:      test: kafka-topics --bootstrap-server localhost:9092 --list      interval: 10s      timeout: 5s      start_period: 30s      retries: 5    labels:      amplicode.image: confluent\/kafka volumes:  postgres_data:  kafka_data:<\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u276f \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0438 \u043c\u043e\u0433\u043b\u043e \u0433\u0438\u0431\u043a\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437\u0432\u043d\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a URL \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL, \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u0434\u0440\u0435\u0441 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 Kafka, \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00abWrap properties into\u00bb \u043e\u0442 Amplicode, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 (<a href=\"http:\/\/application.properties\" rel=\"noopener noreferrer nofollow\">application.properties<\/a>) \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b2\/989\/2bf\/6b29892bf6514bfaccfb6080338568cd.gif\" width=\"2014\" height=\"706\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b2\/989\/2bf\/6b29892bf6514bfaccfb6080338568cd.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b2\/989\/2bf\/6b29892bf6514bfaccfb6080338568cd.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 Docker Compose \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dee\/6ae\/a62\/dee6aea6239e32430cde76e53f204825.png\" width=\"1600\" height=\"1113\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/dee\/6ae\/a62\/dee6aea6239e32430cde76e53f204825.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dee\/6ae\/a62\/dee6aea6239e32430cde76e53f204825.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h2>\u276f \u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a Dockerfile \u0438 docker-compose \u0444\u0430\u0439\u043b \u0433\u043e\u0442\u043e\u0432\u044b, \u043a\u043e\u043c\u043c\u0438\u0442\u0438\u043c \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 GitFlic. \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 Timeweb Cloud, \u0432\u044b\u0431\u0438\u0440\u0430\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 Docker \u0438 Git, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8d6\/2fa\/496\/8d62fa496da875175fe3575cc8fa9cfa.gif\" width=\"2048\" height=\"1152\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8d6\/2fa\/496\/8d62fa496da875175fe3575cc8fa9cfa.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8d6\/2fa\/496\/8d62fa496da875175fe3575cc8fa9cfa.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0441\u044c \u043a \u043d\u0435\u0439 \u043f\u043e SSH:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/56e\/aa3\/96e\/56eaa396e52b113ddb42c23b744c85d1.png\" width=\"1421\" height=\"1600\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/56e\/aa3\/96e\/56eaa396e52b113ddb42c23b744c85d1.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/56e\/aa3\/96e\/56eaa396e52b113ddb42c23b744c85d1.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code><em>docker-compose up -d<\/em><\/code>:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/217\/796\/01a\/21779601a9cf73858440595fe5962d1f.png\" width=\"1600\" height=\"1359\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/217\/796\/01a\/21779601a9cf73858440595fe5962d1f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/217\/796\/01a\/21779601a9cf73858440595fe5962d1f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u043c ip.\u00a0<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/721\/500\/458\/7215004585e3bd08353b5d59b1b3b2f3.png\" width=\"1600\" height=\"944\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/721\/500\/458\/7215004585e3bd08353b5d59b1b3b2f3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/721\/500\/458\/7215004585e3bd08353b5d59b1b3b2f3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432 \u043b\u043e\u0433\u0430\u0445 \u0432\u0438\u0434\u043d\u0435\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c9c\/319\/944\/c9c319944215e157ec85d36ce7f4c544.png\" width=\"1600\" height=\"944\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c9c\/319\/944\/c9c319944215e157ec85d36ce7f4c544.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c9c\/319\/944\/c9c319944215e157ec85d36ce7f4c544.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u043e!<\/p>\n<h2>\u276f \u0418\u0442\u043e\u0433<\/h2>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u0430\u043b\u0435\u043a \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 \u0434\u0435\u043f\u043b\u043e\u044f \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u00ab\u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0439\u00bb \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0435\u043f\u043b\u043e\u044f \u2014 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Kubernetes.<\/p>\n<blockquote>\n<p><a href=\"https:\/\/t.me\/timewebru\" rel=\"noopener noreferrer nofollow\"><strong>\u041d\u043e\u0432\u043e\u0441\u0442\u0438, \u043e\u0431\u0437\u043e\u0440\u044b \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u044b \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b\u00a0<\/strong><\/a><a href=\"http:\/\/Timeweb.Cloud\" rel=\"noopener noreferrer nofollow\"><strong>Timeweb.Cloud<\/strong><\/a><a href=\"https:\/\/t.me\/timewebru\" rel=\"noopener noreferrer nofollow\"><strong>\u00a0\u2014 \u0432 \u043d\u0430\u0448\u0435\u043c Telegram-\u043a\u0430\u043d\u0430\u043b\u0435<\/strong><\/a>\u00a0<strong>\u21a9<\/strong>  <\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/936148\/\"> https:\/\/habr.com\/ru\/articles\/936148\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0434\u0435\u043f\u043b\u043e\u044f, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0438 \u043f\u0443\u0433\u0430\u044e\u0449\u0438\u043c. \u0414\u043e\u043a\u0435\u0440-\u043e\u0431\u0440\u0430\u0437\u044b, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, container registry, \u0430 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 Kubernetes \u2014 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u0430 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0433\u043e\u043b\u043e\u0432\u043d\u0430\u044f \u0431\u043e\u043b\u044c. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0448\u0438 \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u044b \u0438\u0437 Amplicode \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 Spring-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0430 \u043d\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u2014 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u043c \u0432 \u0432\u0438\u0434\u0435\u043e-\u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/6899ff591b1835abde509596\" data-style=\"\" id=\"6899ff591b1835abde509596\" width=\"\"><\/div>\n<blockquote>\n<p><a href=\"https:\/\/vkvideo.ru\/video-28839208_456239568?list=f544830cff0e96f63d\" rel=\"noopener noreferrer nofollow\"><strong>VK \u0412\u0438\u0434\u0435\u043e<\/strong><\/a> \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=lfGDHvepytk\" rel=\"noopener noreferrer nofollow\"><strong>YT<\/strong><\/a><\/p>\n<\/blockquote>\n<h2>\u276f \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 Spring Petclinic, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Spring Boot. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430: \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL \u0438 \u0431\u0440\u043e\u043a\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 Kafka. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0439\u0434\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c: \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 Docker Compose.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u276f \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u2014 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 docker-compose.yml:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0448\u0435 Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u044d\u043a\u0441\u043f\u043e\u0443\u0437\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u0440\u0442\u044b. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 IDE, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0434\u043b\u044f \u043d\u0438\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c\u0438 \u043e\u0442 Amplicode:<\/p>\n<figure class=\"full-width\"><\/figure>\n<details class=\"spoiler\">\n<summary>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>services:   spring-petclinic:     image: org.springframework.samples.spring-petclinic:latest     build:       context: ..\/..       dockerfile: existing-spring-boot-app-modification\/spring-petclinic-main\/Dockerfile       args:         DOCKER_BUILDKIT: 1     restart: \"no\"     ports:       - \"8080:8080\"     healthcheck:       test: wget --no-verbose --tries=1 --spider http:\/\/localhost:8080\/actuator\/health || exit 1       interval: 30s       timeout: 5s       start_period: 30s       retries: 5     labels:       amplicode.image: springboot   <\/code><\/pre>\n<pre><code class=\"xml\">FROM gradle:9.0.0 AS builder WORKDIR \/application COPY . . RUN --mount=type=cache,target=\/root\/.gradle gradle clean :org.springframework.samples.spring-petclinic:build -x test  FROM bellsoft\/liberica-openjre-alpine:23 AS layers WORKDIR \/application COPY --from=builder \/application\/existing-spring-boot-app-modification\/spring-petclinic-main\/build\/libs\/*.jar app.jar RUN java -Djarmode=layertools -jar app.jar extract  FROM bellsoft\/liberica-openjre-alpine:23 VOLUME \/tmp RUN adduser -S spring-user USER spring-user  WORKDIR \/application  COPY --from=layers \/application\/dependencies\/ .\/ COPY --from=layers \/application\/spring-boot-loader\/ .\/ COPY --from=layers \/application\/snapshot-dependencies\/ .\/ COPY --from=layers \/application\/application\/ .\/  ENV JAVA_RESERVED_CODE_CACHE_SIZE=\"240M\" ENV JAVA_MAX_DIRECT_MEMORY_SIZE=\"10M\" ENV JAVA_MAX_METASPACE_SIZE=\"179M\" ENV JAVA_XSS=\"1M\" ENV JAVA_XMX=\"345M\"  ENV JAVA_ERROR_FILE_OPTS=\"-XX:ErrorFile=\/tmp\/java_error.log\" ENV JAVA_HEAP_DUMP_OPTS=\"-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\/tmp\" ENV JAVA_ON_OUT_OF_MEMORY_OPTS=\"-XX:+CrashOnOutOfMemoryError\" ENV JAVA_NATIVE_MEMORY_TRACKING_OPTS=\"-XX:NativeMemoryTracking=summary -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMTStatistics\" ENV JAVA_GC_LOG_OPTS=\"-Xlog:gc*,safepoint:\/tmp\/gc.log::filecount=10,filesize=100M\" ENV JAVA_FLIGHT_RECORDING_OPTS=\"-XX:StartFlightRecording=disk=true,dumponexit=true,filename=\/tmp\/,maxsize=10g,maxage=24h\" ENV JAVA_JMX_REMOTE_OPTS=\"-Djava.rmi.server.hostname=127.0.0.1 \\    -Dcom.sun.management.jmxremote.authenticate=false \\    -Dcom.sun.management.jmxremote.ssl=false \\    -Dcom.sun.management.jmxremote.port=5005 \\    -Dcom.sun.management.jmxremote.rmi.port=5005\"  ENTRYPOINT java \\    -XX:ReservedCodeCacheSize=$JAVA_RESERVED_CODE_CACHE_SIZE \\    -XX:MaxDirectMemorySize=$JAVA_MAX_DIRECT_MEMORY_SIZE \\    -XX:MaxMetaspaceSize=$JAVA_MAX_METASPACE_SIZE \\    -Xss$JAVA_XSS \\    -Xmx$JAVA_XMX \\    $JAVA_HEAP_DUMP_OPTS \\    $JAVA_ON_OUT_OF_MEMORY_OPTS \\    $JAVA_ERROR_FILE_OPTS \\    $JAVA_NATIVE_MEMORY_TRACKING_OPTS \\    $JAVA_GC_LOG_OPTS \\    $JAVA_FLIGHT_RECORDING_OPTS \\    $JAVA_JMX_REMOTE_OPTS \\    org.springframework.boot.loader.JarLauncher <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f compose, \u043c\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 Dockerfile <a href=\"https:\/\/habr.com\/ru\/companies\/spring_aio\/articles\/901302\/\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043b\u0443\u0447\u0448\u0438\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u043c<\/a> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c Dockerfile \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u043b\u0438 \u0434\u0430\u0436\u0435 \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Dockerfile \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 JVM, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0438 \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u043b\u043e \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438: heap dump, GC-\u043b\u043e\u0433\u0438, Java Flight Recorder (JFR) \u0438 JMX. \u042d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c (<s>\u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 <\/s>\u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f).<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><strong><em>\u0412\u0430\u0436\u043d\u044b\u0439 \u043d\u044e\u0430\u043d\u0441:<\/em><\/strong><em> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \/tmp), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0447\u0438\u0449\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438\u043b\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u0414\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d-\u0441\u0440\u0435\u0434\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 volume \u0438\u043b\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0434\u0438\u0441\u043a.<\/em><\/p>\n<h2>\u276f \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 PostgreSQL \u0438 Kafka \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f Docker Compose<\/h2>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 docker-compose.yml \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b PostgreSQL \u0438 Kafka. \u0412 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d-\u0441\u0440\u0435\u0434\u0435 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u043e\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u044d\u0442\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430\u0440\u0443\u0436\u0443 \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u0438\u043c\u0435\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<details class=\"spoiler\">\n<summary>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>services:  postgres:    image: postgres:17.5    restart: \"no\"    volumes:      - postgres_data:\/var\/lib\/postgresql\/data    environment:      POSTGRES_USER: root      POSTGRES_PASSWORD: root      POSTGRES_DB: spring-petclinic    healthcheck:      test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB      interval: 10s      timeout: 5s      start_period: 10s      retries: 5  kafka:    image: confluentinc\/cp-kafka:8.0.0    restart: \"no\"    volumes:      - kafka_data:\/var\/lib\/kafka\/data    environment:      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT:\/\/kafka:29092,PLAINTEXT_HOST:\/\/localhost:9092      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,CONTROLLER:PLAINTEXT      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT      KAFKA_NODE_ID: 1      CLUSTER_ID: koa_uLJGTQe-qKkjpbagQg      KAFKA_PROCESS_ROLES: controller,broker      KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093      KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER      KAFKA_LISTENERS: PLAINTEXT:\/\/kafka:29092,PLAINTEXT_HOST:\/\/0.0.0.0:9092,CONTROLLER:\/\/kafka:9093    healthcheck:      test: kafka-topics --bootstrap-server localhost:9092 --list      interval: 10s      timeout: 5s      start_period: 30s      retries: 5    labels:      amplicode.image: confluent\/kafka volumes:  postgres_data:  kafka_data:<\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u276f \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0438 \u043c\u043e\u0433\u043b\u043e \u0433\u0438\u0431\u043a\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437\u0432\u043d\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a URL \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL, \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u0434\u0440\u0435\u0441 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 Kafka, \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00abWrap properties into\u00bb \u043e\u0442 Amplicode, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 (<a href=\"http:\/\/application.properties\" rel=\"noopener noreferrer nofollow\">application.properties<\/a>) \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 Docker Compose \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u276f \u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a Dockerfile \u0438 docker-compose \u0444\u0430\u0439\u043b \u0433\u043e\u0442\u043e\u0432\u044b, \u043a\u043e\u043c\u043c\u0438\u0442\u0438\u043c \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 GitFlic. \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 Timeweb Cloud, \u0432\u044b\u0431\u0438\u0440\u0430\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 Docker \u0438 Git, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0441\u044c \u043a \u043d\u0435\u0439 \u043f\u043e SSH:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code><em>docker-compose up -d<\/em><\/code>:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u043c ip.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432 \u043b\u043e\u0433\u0430\u0445 \u0432\u0438\u0434\u043d\u0435\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u043e!<\/p>\n<h2>\u276f \u0418\u0442\u043e\u0433<\/h2>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u0430\u043b\u0435\u043a \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 \u0434\u0435\u043f\u043b\u043e\u044f \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u00ab\u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0439\u00bb \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0435\u043f\u043b\u043e\u044f \u2014 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Kubernetes.<\/p>\n<blockquote>\n<p><a href=\"https:\/\/t.me\/timewebru\" rel=\"noopener noreferrer nofollow\"><strong>\u041d\u043e\u0432\u043e\u0441\u0442\u0438, \u043e\u0431\u0437\u043e\u0440\u044b \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u044b \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b\u00a0<\/strong><\/a><a href=\"http:\/\/Timeweb.Cloud\" rel=\"noopener noreferrer nofollow\"><strong>Timeweb.Cloud<\/strong><\/a><a href=\"https:\/\/t.me\/timewebru\" rel=\"noopener noreferrer nofollow\"><strong>\u00a0\u2014 \u0432 \u043d\u0430\u0448\u0435\u043c Telegram-\u043a\u0430\u043d\u0430\u043b\u0435<\/strong><\/a>\u00a0<strong>\u21a9<\/strong>  <\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/936148\/\"> https:\/\/habr.com\/ru\/articles\/936148\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-470673","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=470673"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470673\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=470673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=470673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=470673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}