diff --git a/ats/trouter/Dockerfile b/ats/trouter/Dockerfile new file mode 100644 index 00000000..21759ace --- /dev/null +++ b/ats/trouter/Dockerfile @@ -0,0 +1,23 @@ +FROM java_base + +EXPOSE 8095 8443 +ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80 + +ARG ALFRESCO_TROUTER_GROUP_NAME +ARG ALFRESCO_TROUTER_GROUP_ID +ARG ALFRESCO_TROUTER_USER_NAME +ARG ALFRESCO_TROUTER_USER_ID + +ADD ats/trouter/alfresco-transform-router*.jar /opt/app.jar + +RUN groupadd -g ${ALFRESCO_TROUTER_GROUP_ID} ${ALFRESCO_TROUTER_GROUP_NAME} && \ + useradd -u ${ALFRESCO_TROUTER_USER_ID} -g ${ALFRESCO_TROUTER_GROUP_NAME} ${ALFRESCO_TROUTER_USER_NAME} && \ + chgrp ${ALFRESCO_TROUTER_GROUP_NAME} /opt/app.jar + +USER ${ALFRESCO_TROUTER_USER_NAME} + +HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1m \ + CMD curl -f http://localhost:8095/actuator/health || exit 1 + +COPY ats/trouter/entrypoint.sh /entrypoint.sh +CMD ["/entrypoint.sh"] diff --git a/ats/trouter/README.md b/ats/trouter/README.md new file mode 100644 index 00000000..4812059f --- /dev/null +++ b/ats/trouter/README.md @@ -0,0 +1,41 @@ +# Runtime variables + +Sets of variables configurable with your docker image + +## trouter + +```yaml + +transform-router: + image: alfresco-transform-router:YOUR-TAG + environment: + JAVA_OPTS: + ACTIVEMQ_URL: nio://activemq:61616 + ACTIVEMQ_USER: "admin" + ACTIVEMQ_PASSWORD: "admin" + + CORE_AIO_URL: http://transform-core-aio:8090 + FILE_STORE_URL: http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file + + TRANSFORMER_ENGINE_PROTOCOL: jms + + IMAGEMAGICK_URL: "http://imagemagick:8090" + PDF_RENDERER_URL: "http://alfresco-pdf-renderer:8090" + LIBREOFFICE_URL: "http://libreoffice:8090" + TIKA_URL: "http://tika:8090" + MISC_URL: "http://misc:8090" + +``` + +- `JAVA_OPTS` - Additional java options +- `ACTIVEMQ_URL` - The URL for Alfresco ActiveMQ. +- `ACTIVEMQ_USER` - The username for ActiveMQ. +- `ACTIVEMQ_PASSWORD` - The password for ActiveMQ. +- `CORE_AIO_URL` - Transform Core AIO server +- `FILE_STORE_URL` - The URL for the Alfresco Shared FileStore endpoint. +- `TRANSFORMER_ENGINE_PROTOCOL` - Specifies the protocol used by the transform engine. For example, `jms`. +- `IMAGEMAGICK_URL` - The URL for the ImageMagick service +- `PDF_RENDERER_URL` - The URL for the PDF Renderer service +- `LIBREOFFICE_URL` - The URL for the LibreOffice service +- `TIKA_URL` - The URL for the Tika service +- `MISC_URL` - The URL for Mics service diff --git a/ats/trouter/artifacts.json b/ats/trouter/artifacts.json new file mode 100644 index 00000000..6b732a0a --- /dev/null +++ b/ats/trouter/artifacts.json @@ -0,0 +1,13 @@ +{ + "artifacts": { + "acs23": [ + { + "name": "alfresco-transform-router", + "version": "4.1.3", + "path": "ats/trouter", + "classifier": ".jar", + "group": "org.alfresco" + } + ] + } +} diff --git a/ats/trouter/entrypoint.sh b/ats/trouter/entrypoint.sh new file mode 100755 index 00000000..1f50ab1c --- /dev/null +++ b/ats/trouter/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /opt/app.jar diff --git a/docker-bake.hcl b/docker-bake.hcl index 187729c0..af80712e 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,5 +1,5 @@ group "default" { - targets = ["content_service", "enterprise-search"] + targets = ["content_service", "enterprise-search", "ats"] } group "content_service" { @@ -10,6 +10,10 @@ group "enterprise-search" { targets = ["search_liveindexing"] } +group "ats" { + targets = ["ats_trouter"] +} + variable "LABEL_VENDOR" { default = "Hyland Software, Inc." } @@ -108,7 +112,7 @@ target "java_base" { "org.opencontainers.image.source" = "$LABEL_SOURCE" "org.opencontainers.image.authors" = "${LABEL_AUTHOR}" } - tags = ["alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] + tags = ["localhost/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] output = ["type=cacheonly"] } @@ -150,7 +154,7 @@ target "tomcat_base" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Tomcat" "org.opencontainers.image.description" = "A base image shipping Tomcat for Alfresco Products" } - tags = ["alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] + tags = ["localhost/alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] output = ["type=cacheonly"] } @@ -171,7 +175,7 @@ target "repository" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Content Repository" "org.opencontainers.image.description" = "Alfresco Content Services Repository" } - tags = ["alfresco-content-repository:latest"] + tags = ["localhost/alfresco-content-repository:latest"] output = ["type=docker"] } @@ -209,6 +213,42 @@ target "search_liveindexing" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing.name}" "org.opencontainers.image.description" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing.name} live indexing" } - tags = ["${liveindexing.artifact}:latest"] + tags = ["localhost/${liveindexing.artifact}:latest"] + output = ["type=docker"] +} + +variable "ALFRESCO_TROUTER_GROUP_NAME" { + default = "Alfresco" +} + +variable "ALFRESCO_TROUTER_GROUP_ID" { + default = "1000" +} + +variable "ALFRESCO_TROUTER_USER_NAME" { + default = "trouter" +} + +variable "ALFRESCO_TROUTER_USER_ID" { + default = "33016" +} + +target "ats_trouter" { + dockerfile = "./ats/trouter/Dockerfile" + inherits = ["java_base"] + contexts = { + java_base = "target:java_base" + } + args = { + ALFRESCO_TROUTER_GROUP_NAME = "${ALFRESCO_TROUTER_GROUP_NAME}" + ALFRESCO_TROUTER_GROUP_ID = "${ALFRESCO_TROUTER_GROUP_ID}" + ALFRESCO_TROUTER_USER_NAME = "${ALFRESCO_TROUTER_USER_NAME}" + ALFRESCO_TROUTER_USER_ID = "${ALFRESCO_TROUTER_USER_ID}" + } + labels = { + "org.opencontainers.image.title" = "${PRODUCT_LINE} ATS Trouter" + "org.opencontainers.image.description" = "Alfresco Transform Service Trouter" + } + tags = ["localhost/alfresco-transform-router:latest"] output = ["type=docker"] } diff --git a/docker-compose/docker-compose-components.yml b/docker-compose/docker-compose-components.yml index fbb63eb2..45ea9bdf 100644 --- a/docker-compose/docker-compose-components.yml +++ b/docker-compose/docker-compose-components.yml @@ -49,11 +49,8 @@ services: start_period: 1m transform-router: mem_limit: 512m - image: quay.io/alfresco/alfresco-transform-router:4.1.2 + image: localhost/alfresco-transform-router:latest environment: - JAVA_OPTS: >- - -XX:MinRAMPercentage=50 - -XX:MaxRAMPercentage=80 ACTIVEMQ_URL: nio://activemq:61616 CORE_AIO_URL: http://transform-core-aio:8090 FILE_STORE_URL: >- @@ -182,17 +179,17 @@ services: ports: - "9090:9090" live-indexing-metadata: - image: alfresco-elasticsearch-live-indexing-metadata:latest + image: localhost/alfresco-elasticsearch-live-indexing-metadata:latest environment: SPRING_ELASTICSEARCH_REST_URIS: http://elastic:9200 SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616 live-indexing-path: - image: alfresco-elasticsearch-live-indexing-path:latest + image: localhost/alfresco-elasticsearch-live-indexing-path:latest environment: SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200 SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616 live-indexing-content: - image: alfresco-elasticsearch-live-indexing-content:latest + image: localhost/alfresco-elasticsearch-live-indexing-content:latest environment: SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200 SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616 diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 5a4b3a30..769326c6 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -49,11 +49,8 @@ services: start_period: 1m transform-router: mem_limit: 512m - image: quay.io/alfresco/alfresco-transform-router:4.1.2 + image: localhost/alfresco-transform-router:latest environment: - JAVA_OPTS: >- - -XX:MinRAMPercentage=50 - -XX:MaxRAMPercentage=80 ACTIVEMQ_URL: nio://activemq:61616 CORE_AIO_URL: http://transform-core-aio:8090 FILE_STORE_URL: >- @@ -182,7 +179,7 @@ services: ports: - "9090:9090" live-indexing: - image: alfresco-elasticsearch-live-indexing:latest + image: localhost/alfresco-elasticsearch-live-indexing:latest environment: SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200 SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616 diff --git a/scripts/fetch-artifact.sh b/scripts/fetch-artifact.sh index 5bc86fe7..38d0483a 100755 --- a/scripts/fetch-artifact.sh +++ b/scripts/fetch-artifact.sh @@ -10,7 +10,7 @@ cd ${REPO_ROOT}/.. for i in $(find . -name artifacts.json -mindepth 2); do for j in $(jq -r ".artifacts.acs${INDEX_KEY} | keys | .[]" $i); do - ARTIFACT_BASEURL="https://nexus.alfresco.com/nexus/service/local/repositories/enterprise-releases/content" + ARTIFACT_BASEURL="https://nexus.alfresco.com/nexus/service/local/repositories/enterprise-releases" ARTIFACT_NAME=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].name" $i) ARTIFACT_VERSION=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].version" $i) ARTIFACT_EXT=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].classifier" $i)