kroki
kroki copied to clipboard
Move installLocalDependencies and buildServer to Dockerfile
Today the build pipeline consists of two steps. Prepare server build and build server locally and then build containers.
To ease local testing I like to suggest moving the server build into a FROM maven:3-eclipse-temurin-11-focal as kroki-build-server
(or similar) section of the servers dockerfile.
And copy the jar from the builder
diff --git a/server/ops/docker/jdk11-alpine/Dockerfile b/server/ops/docker/jdk11-alpine/Dockerfile
index 3b7c7da..cfa482a 100644
--- a/server/ops/docker/jdk11-alpine/Dockerfile
+++ b/server/ops/docker/jdk11-alpine/Dockerfile
@@ -211,7 +211,7 @@ ENV KROKI_PIKCHR_BIN_PATH=/usr/bin/pikchr
ENV KROKI_D2_BIN_PATH=/usr/bin/d2
ENV JAVA_OPTS="-Dlogback.configurationFile=/etc/kroki/logback.xml -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.SLF4JLogDelegateFactory"
-COPY --chown=kroki:kroki target/kroki-server.jar /usr/local/kroki/kroki-server.jar
+COPY --from=kroki-builder-server /kroki/target/kroki-server.jar /usr/local/kroki/kroki-server.jar
EXPOSE 8000
Why not, that's a good idea 👍🏻