Skip to content

Commit

Permalink
NO-ISSUE:serverless-logic-web-tools-swf-dev-mode-image optimization…
Browse files Browse the repository at this point in the history
…s for filesize (#2590)
  • Loading branch information
thiagoelg authored Sep 13, 2024
1 parent 21a05ac commit 78825a9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,26 @@ FROM --platform=linux/amd64 docker.io/apache/incubator-kie-kogito-base-builder:$
ENV PATH="${PATH}:/usr/share/maven/bin"

USER root
RUN chown kogito /home/kogito/.m2
USER kogito

COPY --chown=kogito:root dist-dev/quarkus-app/ /home/kogito/serverless-logic-web-tools-swf-deployment-quarkus-app/
COPY --chown=kogito:root dist-dev/settings.xml /home/kogito/.m2/settings.xml
COPY --chown=kogito:root entrypoint.sh /home/kogito/entrypoint.sh

WORKDIR /home/kogito/serverless-logic-web-tools-swf-deployment-quarkus-app/

RUN rm -rf src/test/ && \
RUN chown kogito /home/kogito/.m2 && \
rm -rf src/test/ && \
mvn clean package \
quarkus:go-offline \
-B \
-ntp \
-s /home/kogito/.m2/settings.xml \
-Dmaven.test.skip \
-Dmaven.repo.local=/home/kogito/.m2/repository \
-Dquarkus-profiles=build,dev
-Dquarkus-profiles=build,dev && \
chmod -R 775 /home/kogito && \
mkdir -p -m 777 /tmp/app

USER root
RUN chmod -R 775 /home/kogito && mkdir -p -m 777 /tmp/app
USER kogito

EXPOSE 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"url": "https://github.com/apache/incubator-kie-tools/issues"
},
"scripts": {
"build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy:assets\" \"pnpm image:docker:build\" --finally \"pnpm m2-repo-via-http:container:kill\"",
"build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy:assets\" \"pnpm image:docker:build\" \"pnpm image:docker:squash\" --finally \"pnpm m2-repo-via-http:container:kill\"",
"build:dev": "pnpm build",
"build:prod": "pnpm build",
"copy:assets": "rimraf dist-dev && mkdir -p ./dist-dev && pnpm copy:quarkus-app && pnpm copy:sonataflow-deployment-webapp && pnpm copy:maven-m2-repo-via-http-image--settings-xml",
Expand All @@ -27,6 +27,7 @@
"copy:sonataflow-deployment-webapp:linux:darwin": "cp -R ./node_modules/sonataflow-deployment-webapp/dist/* ./dist-dev/quarkus-app/src/main/resources/META-INF/resources",
"copy:sonataflow-deployment-webapp:win32": "pnpm powershell \"Copy-Item -R ./node_modules/sonataflow-deployment-webapp/dist/* ./dist-dev/quarkus-app/src/main/resources/META-INF/resources\"",
"image:docker:build": "kie-tools--image-builder build --allowHostNetworkAccess -r \"$(build-env swfDevModeImageEnv.registry)\" -a \"$(build-env swfDevModeImageEnv.account)\" -n \"$(build-env swfDevModeImageEnv.name)\" -t \"$(build-env swfDevModeImageEnv.buildTag)\" --build-arg KOGITO_IMAGE_TAG=\"$(build-env swfDevModeImage.kogitoImageTag)\"",
"image:docker:squash": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && DOCKER_HOST=$(docker context inspect | jq '.[].Endpoints.docker.Host' | tr -d '\"') docker-squash -t $(build-env swfDevModeImageEnv.registry)/$(build-env swfDevModeImageEnv.account)/$(build-env swfDevModeImageEnv.name):$(build-env swfDevModeImageEnv.buildTag) $(build-env swfDevModeImageEnv.registry)/$(build-env swfDevModeImageEnv.account)/$(build-env swfDevModeImageEnv.name):$(build-env swfDevModeImageEnv.buildTag)",
"install": "node install.js",
"m2-repo-via-http:container:kill": "(docker container kill m2-repo-via-http || true) && (docker container rm m2-repo-via-http || true)",
"m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && docker run --name m2-repo-via-http -v \"$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout):/var/www/html\" -dit $(build-env swfDevModeImage.dev.mavenM2RepoViaHttpImage)",
Expand All @@ -36,6 +37,7 @@
"@kie-tools/image-builder": "workspace:*",
"@kie-tools/maven-config-setup-helper": "workspace:*",
"@kie-tools/maven-m2-repo-via-http-image": "workspace:*",
"@kie-tools/python-venv": "workspace:*",
"@kie-tools/root-env": "workspace:*",
"@kie-tools/serverless-logic-web-tools-swf-deployment-quarkus-app": "workspace:*",
"@kie-tools/serverless-logic-web-tools-swf-dev-mode-image-env": "workspace:*",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions repo/graph.dot
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ digraph G {
"@kie-tools/serverless-logic-web-tools-swf-builder-image-env" -> "@kie-tools/root-env" [ style = "dashed", color = "black" ];
"@kie-tools/serverless-logic-web-tools-swf-deployment-quarkus-app" -> "@kie-tools/sonataflow-quarkus-devui" [ style = "solid", color = "black" ];
"@kie-tools/serverless-logic-web-tools-swf-dev-mode-image" -> "@kie-tools/maven-m2-repo-via-http-image" [ style = "dashed", color = "black" ];
"@kie-tools/serverless-logic-web-tools-swf-dev-mode-image" -> "@kie-tools/python-venv" [ style = "dashed", color = "black" ];
"@kie-tools/serverless-logic-web-tools-swf-dev-mode-image" -> "@kie-tools/serverless-logic-web-tools-swf-deployment-quarkus-app" [ style = "dashed", color = "black" ];
"@kie-tools/serverless-logic-web-tools-swf-dev-mode-image" -> "@kie-tools/serverless-logic-web-tools-swf-dev-mode-image-env" [ style = "dashed", color = "black" ];
"@kie-tools/serverless-logic-web-tools-swf-dev-mode-image" -> "sonataflow-deployment-webapp" [ style = "dashed", color = "black" ];
Expand Down
5 changes: 5 additions & 0 deletions repo/graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -2261,6 +2261,11 @@
"target": "@kie-tools/maven-m2-repo-via-http-image",
"weight": 1
},
{
"source": "@kie-tools/serverless-logic-web-tools-swf-dev-mode-image",
"target": "@kie-tools/python-venv",
"weight": 1
},
{
"source": "@kie-tools/serverless-logic-web-tools-swf-dev-mode-image",
"target": "@kie-tools/serverless-logic-web-tools-swf-deployment-quarkus-app",
Expand Down

0 comments on commit 78825a9

Please sign in to comment.