{"id":318740,"date":"2021-02-27T21:00:44","date_gmt":"2021-02-27T21:00:44","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=318740"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=318740","title":{"rendered":"\u0428\u0430\u0431\u043b\u043e\u043d Kotlin \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u043b\u0435\u0447\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u043c\u0430\u043b\u043e \u0440\u0443\u0442\u0438\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438: \u0431\u0438\u043b\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0442\u0435\u0441\u0442\u044b, docker, k8s \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b. \u0420\u0430\u0437 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u044d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0443, \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 IDE \u043d\u0435\u0434\u043e\u0441\u0442\u043e\u0447\u043d\u043e. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u043e\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e \u043e\u0434\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 &#171;\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u043e&#187; \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u043c\u044b\u0435 \u043a\u043e\u0434\u043e\u043c, \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c. <br \/>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u043e\u0434\u0438\u043d \u043a\u043b\u0438\u043a \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u043c \u0432 Digital Ocean \u0437\u0432\u0443\u0447\u0430\u0442 \u0437\u0430\u043c\u0430\u043d\u0447\u0438\u0432\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0448\u0430\u0431\u043b\u043e\u043d \u0438 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0431\u043e\u0440\u043a\u0438. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043b\u044e\u0431\u043e\u0432\u044c \u043c\u043d\u043e\u0433\u0438\u0445 \u043a maven \u0437\u0430 \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c gradle, \u0438\u0431\u043e \u043e\u043d \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u0435\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0433\u043e Kotlin \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u0438\u043d:<\/p>\n<pre><code class=\"kotlin\">plugins {   kotlin(\"jvm\") version \"1.4.30\"    \/\/ \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441 \u043f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0439 jvm   id(\"org.beryx.runtime\") version \"1.12.1\" }<\/code><\/pre>\n<p>\u0418\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d &#171;\u0440\u043e\u0434\u043d\u043e\u0439&#187; \u0434\u043b\u044f Kotlin <a href=\"https:\/\/ktor.io\/\" rel=\"noopener noreferrer nofollow\">Ktor<\/a>. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u043a\u0430 JUnit + Hamkrest \u0441 \u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c DSL, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"kotlin\">assertThat(\"xyzzy\", startsWith(\"x\") and endsWith(\"y\") and !containsSubstring(\"a\"))<\/code><\/pre>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u044f\u0441\u044c \u043d\u0430 Java 15+<\/p>\n<pre><code class=\"kotlin\">dependencies {   implementation(\"com.github.ajalt.clikt:clikt:3.1.0\")   implementation(\"io.ktor:ktor-server-netty:1.5.1\")   testImplementation(\"org.junit.jupiter:junit-jupiter:5.8.0-M1\")   testImplementation(\"com.natpryce:hamkrest:1.8.0.1\")   testImplementation(\"io.mockk:mockk:1.10.6\") }  application {   mainClass.set(\"AppKt\") }  tasks {   test {     useJUnitPlatform()   }   compileKotlin {     kotlinOptions.jvmTarget = \"15\"   } }<\/code><\/pre>\n<p>\u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d entry-point \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0434\u044f \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0430, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u0441\u0442 (\u0437\u0430\u043e\u0434\u043d\u043e \u0441\u043b\u0443\u0436\u0430\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u043e\u0432\u0430\u043d\u0438\u044f Hamkrest). <br \/>\u0418\u0437 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u0441\u0435\u0431\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u043e\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c Kotlin codestyle \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0432 \u0435\u0433\u043e \u0432 .editorsconfig:<\/p>\n<pre><code class=\"kotlin\">[*.{kt, kts, java, xml, html, js}] max_line_length = 120 indent_size = 2 continuation_indent_size = 2<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u043a\u0443\u0441\u0430, \u043d\u043e \u0435\u0449\u0451 \u0442\u0430\u043a \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043b\u044f\u043c\u0431\u0434\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<pre><code class=\"bash\">gradle clean test runtime<\/code><\/pre>\n<p>\u041f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>build\/image<\/em>) \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 <em>build\/image\/bin<\/em><\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c Dockerfile, \u0435\u0433\u043e \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<pre><code class=\"kotlin\"># syntax = docker\/dockerfile:experimental FROM gradle:jdk15 as builder WORKDIR \/app COPY src .\/src COPY build.gradle.kts .\/build.gradle.kts RUN --mount=type=cache,target=.\/.gradle gradle clean test install  FROM openjdk:15 as backend WORKDIR \/root COPY --from=builder \/app\/build\/install\/app .\/<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0441 jdk (\u0430 \u043d\u0435 \u0441 jvm) \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 c \u043f\u043e\u043c\u043e\u0449\u044c\u044e jstack\/jmap \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0441 jdk.<\/p>\n<p>\u0421\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Docker Compose:<\/p>\n<pre><code>version: \"3.9\"  services:   backend:     build: .     command: bin\/app     ports:       - \"80:80\"<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0432\u0438\u0434\u0435 jdk\/gradle, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<pre><code class=\"bash\">docker-compose up<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e? \u0412\u044b\u0431\u0440\u0430\u043b Digital Ocean \u0438\u0437-\u0437\u0430 \u0434\u0435\u0448\u0435\u0432\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Apps Platform \u0438&#8230; \u0432\u0441\u0435! \u0424\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Docker \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0446\u0435\u043f\u043b\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043b\u043e\u0433\u0438 \u0441\u0431\u043e\u0440\u043a\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0435\u0431 \u0430\u0434\u0440\u0435\u0441\u0443, \u043b\u043e\u0433\u0430\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0438 \u0441\u0442\u043e\u0438\u0442 5$ \u0432 \u043c\u0435\u0441\u044f\u0446:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c6b\/099\/586\/c6b099586afa9994642a5ccc2b4347fd.png\" width=\"1894\" height=\"1108\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 master \u0432\u0435\u0442\u043a\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043f\u0435\u0440\u0435\u0434\u0435\u043f\u043b\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0443\u0434\u043e\u0431\u043d\u043e. <br \/>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 README.md \u0444\u0430\u0439\u043b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u0434\u0435\u043f\u043b\u043e\u0439 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0436\u0430\u0432 \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0443 <code>\"Use this template\"<\/code>\u043d\u0430 GitHub:<br \/><a href=\"https:\/\/github.com\/demidko\/Projekt-portable\" rel=\"noopener noreferrer nofollow\">github.com\/demidko\/Projekt-portable<\/a><\/p>\n<p>\u0418\u043b\u0438, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 self-executable jar \u0431\u0435\u0437 \u043f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0439 jvm:<br \/><a href=\"https:\/\/github.com\/demidko\/Projekt-jar\" rel=\"noopener noreferrer nofollow\">github.com\/demidko\/Projekt-jar<\/a><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \ud83d\ude42 \u041a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0435 \u043b\u0438\u0448\u0435\u043d \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u043a\u0440\u0438\u0442\u0438\u043a\u0443.<\/p>\n<\/div>\n<p> \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\/post\/544538\/\"> https:\/\/habr.com\/ru\/post\/544538\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u043b\u0435\u0447\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u043c\u0430\u043b\u043e \u0440\u0443\u0442\u0438\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438: \u0431\u0438\u043b\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0442\u0435\u0441\u0442\u044b, docker, k8s \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b. \u0420\u0430\u0437 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u044d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0443, \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 IDE \u043d\u0435\u0434\u043e\u0441\u0442\u043e\u0447\u043d\u043e. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u043e\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e \u043e\u0434\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 &#171;\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u043e&#187; \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u043c\u044b\u0435 \u043a\u043e\u0434\u043e\u043c, \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c. <br \/>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u043e\u0434\u0438\u043d \u043a\u043b\u0438\u043a \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u043c \u0432 Digital Ocean \u0437\u0432\u0443\u0447\u0430\u0442 \u0437\u0430\u043c\u0430\u043d\u0447\u0438\u0432\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0448\u0430\u0431\u043b\u043e\u043d \u0438 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0431\u043e\u0440\u043a\u0438. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043b\u044e\u0431\u043e\u0432\u044c \u043c\u043d\u043e\u0433\u0438\u0445 \u043a maven \u0437\u0430 \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c gradle, \u0438\u0431\u043e \u043e\u043d \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u0435\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0433\u043e Kotlin \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u0438\u043d:<\/p>\n<pre><code class=\"kotlin\">plugins {   kotlin(\"jvm\") version \"1.4.30\"    \/\/ \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441 \u043f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0439 jvm   id(\"org.beryx.runtime\") version \"1.12.1\" }<\/code><\/pre>\n<p>\u0418\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d &#171;\u0440\u043e\u0434\u043d\u043e\u0439&#187; \u0434\u043b\u044f Kotlin <a href=\"https:\/\/ktor.io\/\" rel=\"noopener noreferrer nofollow\">Ktor<\/a>. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u043a\u0430 JUnit + Hamkrest \u0441 \u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c DSL, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"kotlin\">assertThat(\"xyzzy\", startsWith(\"x\") and endsWith(\"y\") and !containsSubstring(\"a\"))<\/code><\/pre>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u044f\u0441\u044c \u043d\u0430 Java 15+<\/p>\n<pre><code class=\"kotlin\">dependencies {   implementation(\"com.github.ajalt.clikt:clikt:3.1.0\")   implementation(\"io.ktor:ktor-server-netty:1.5.1\")   testImplementation(\"org.junit.jupiter:junit-jupiter:5.8.0-M1\")   testImplementation(\"com.natpryce:hamkrest:1.8.0.1\")   testImplementation(\"io.mockk:mockk:1.10.6\") }  application {   mainClass.set(\"AppKt\") }  tasks {   test {     useJUnitPlatform()   }   compileKotlin {     kotlinOptions.jvmTarget = \"15\"   } }<\/code><\/pre>\n<p>\u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d entry-point \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0434\u044f \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0430, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u0441\u0442 (\u0437\u0430\u043e\u0434\u043d\u043e \u0441\u043b\u0443\u0436\u0430\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u043e\u0432\u0430\u043d\u0438\u044f Hamkrest). <br \/>\u0418\u0437 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u0441\u0435\u0431\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u043e\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c Kotlin codestyle \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0432 \u0435\u0433\u043e \u0432 .editorsconfig:<\/p>\n<pre><code class=\"kotlin\">[*.{kt, kts, java, xml, html, js}] max_line_length = 120 indent_size = 2 continuation_indent_size = 2<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u043a\u0443\u0441\u0430, \u043d\u043e \u0435\u0449\u0451 \u0442\u0430\u043a \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043b\u044f\u043c\u0431\u0434\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<pre><code class=\"bash\">gradle clean test runtime<\/code><\/pre>\n<p>\u041f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>build\/image<\/em>) \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 <em>build\/image\/bin<\/em><\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c Dockerfile, \u0435\u0433\u043e \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<pre><code class=\"kotlin\"># syntax = docker\/dockerfile:experimental FROM gradle:jdk15 as builder WORKDIR \/app COPY src .\/src COPY build.gradle.kts .\/build.gradle.kts RUN --mount=type=cache,target=.\/.gradle gradle clean test install  FROM openjdk:15 as backend WORKDIR \/root COPY --from=builder \/app\/build\/install\/app .\/<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0441 jdk (\u0430 \u043d\u0435 \u0441 jvm) \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 c \u043f\u043e\u043c\u043e\u0449\u044c\u044e jstack\/jmap \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0441 jdk.<\/p>\n<p>\u0421\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Docker Compose:<\/p>\n<pre><code>version: \"3.9\"  services:   backend:     build: .     command: bin\/app     ports:       - \"80:80\"<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0432\u0438\u0434\u0435 jdk\/gradle, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<pre><code class=\"bash\">docker-compose up<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e? \u0412\u044b\u0431\u0440\u0430\u043b Digital Ocean \u0438\u0437-\u0437\u0430 \u0434\u0435\u0448\u0435\u0432\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Apps Platform \u0438&#8230; \u0432\u0441\u0435! \u0424\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Docker \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0446\u0435\u043f\u043b\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043b\u043e\u0433\u0438 \u0441\u0431\u043e\u0440\u043a\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0435\u0431 \u0430\u0434\u0440\u0435\u0441\u0443, \u043b\u043e\u0433\u0430\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0438 \u0441\u0442\u043e\u0438\u0442 5$ \u0432 \u043c\u0435\u0441\u044f\u0446:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 master \u0432\u0435\u0442\u043a\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043f\u0435\u0440\u0435\u0434\u0435\u043f\u043b\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0443\u0434\u043e\u0431\u043d\u043e. <br \/>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 README.md \u0444\u0430\u0439\u043b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u0434\u0435\u043f\u043b\u043e\u0439 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0436\u0430\u0432 \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0443 <code>\"Use this template\"<\/code>\u043d\u0430 GitHub:<br \/><a href=\"https:\/\/github.com\/demidko\/Projekt-portable\" rel=\"noopener noreferrer nofollow\">github.com\/demidko\/Projekt-portable<\/a><\/p>\n<p>\u0418\u043b\u0438, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 self-executable jar \u0431\u0435\u0437 \u043f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0439 jvm:<br \/><a href=\"https:\/\/github.com\/demidko\/Projekt-jar\" rel=\"noopener noreferrer nofollow\">github.com\/demidko\/Projekt-jar<\/a><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \ud83d\ude42 \u041a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0435 \u043b\u0438\u0448\u0435\u043d \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u043a\u0440\u0438\u0442\u0438\u043a\u0443.<\/p>\n<\/div>\n<p> \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\/post\/544538\/\"> https:\/\/habr.com\/ru\/post\/544538\/<\/a><br \/><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/p>\n<p><\/br><\/p>\n<p><\/br><\/p>\n<p><\/br><\/p>\n<\/p>\n<p><\/br><\/br><\/p>\n<\/div>\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-318740","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318740","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=318740"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318740\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}