Skip to content

Commit

Permalink
OPSEXP-2731 Add T-Engine AIO Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Aug 6, 2024
1 parent d00e80e commit 69f85b7
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 1 deletion.
28 changes: 28 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,31 @@ target "tengine_pdfrenderer" {
tags = ["localhost/alfresco-pdf-renderer:latest"]
output = ["type=docker"]
}

variable "ALFRESCO_AIO_USER_NAME" {
default = "transform-all-in-one"
}

variable "ALFRESCO_AIO_USER_ID" {
default = "33017"
}

target "tengine_aio" {
dockerfile = "./tengine/aio/Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
}
args = {
ALFRESCO_AIO_GROUP_NAME = "${ALFRESCO_GROUP_NAME}"
ALFRESCO_AIO_GROUP_ID = "${ALFRESCO_GROUP_ID}"
ALFRESCO_AIO_USER_NAME = "${ALFRESCO_AIO_USER_NAME}"
ALFRESCO_AIO_USER_ID = "${ALFRESCO_AIO_USER_ID}"
}
labels = {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine All In One"
"org.opencontainers.image.description" = "Alfresco Transform Engine All In One"
}
tags = ["localhost/alfresco-transform-core-aio:latest"]
output = ["type=docker"]
}
42 changes: 42 additions & 0 deletions tengine/aio/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM java_base

ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80

ENV COMMON_PATH=tengine
ENV AIO_COMMON_PATH=tengine/aio
ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
ENV TIKA_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

EXPOSE 8090

ARG ALFRESCO_AIO_GROUP_NAME
ARG ALFRESCO_AIO_GROUP_ID
ARG ALFRESCO_AIO_USER_NAME
ARG ALFRESCO_AIO_USER_ID

RUN --mount=type=bind,source=${COMMON_PATH},target=/dist \
mkdir /tmp/dist && \
tar xzf /dist/libreoffice/*.gz -C /tmp/dist && \
yum localinstall -y /tmp/dist/LibreOffice*/RPMS/*.rpm && \
yum install -y cairo cups-libs libSM libGLU && \
yum install -y $IMAGEMAGICK_DEP_RPM_URL && \
yum install -y /dist/imagemagick/imagemagick-distribution-el9.rpm /dist/imagemagick/libs/imagemagick-distribution-libs-el9.rpm; && \
tar xzf /dist/pdfrenderer/*.tgz -C /usr/bin && \
yum install -y ${TIKA_DEP_RPM_URL} && \
yum -y install perl-Image-ExifTool && \
rm -rf /tmp/dist && \
yum clean all

ADD ${AIO_COMMON_PATH}/alfresco-transform-core-aio*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_AIO_GROUP_ID} ${ALFRESCO_AIO_GROUP_NAME} && \
useradd -u ${ALFRESCO_AIO_USER_ID} -g ${ALFRESCO_AIO_GROUP_NAME} ${ALFRESCO_AIO_USER_NAME} && \
chgrp ${ALFRESCO_AIO_GROUP_NAME} /opt/app.jar

USER ${ALFRESCO_AIO_USER_NAME}

HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${AIO_COMMON_PATH}/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
22 changes: 22 additions & 0 deletions tengine/aio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Runtime variables

Sets of variables configurable with your docker image

## libreoffice

```yaml

transform-core-aio:
image: localhost/alfresco-transform-core-aio:YOUR-TAG
environment:
JAVA_OPTS:
ACTIVEMQ_URL: nio://activemq:61616
ACTIVEMQ_USER: admin
ACTIVEMQ_PASSWORD: admin
FILE_STORE_URL: http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file

```

- `JAVA_OPTS` - Additional java options
- `ACTIVEMQ_URL` - The URL for Alfresco ActiveMQ.
- `FILE_STORE_URL` - Alfresco Shared FileStore endpoint.
14 changes: 14 additions & 0 deletions tengine/aio/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-transform-core-aio",
"version": "5.1.3",
"path": "tengine/aio",
"classifier": ".jar",
"repository": "releases",
"group": "org.alfresco"
}
]
}
}
2 changes: 2 additions & 0 deletions tengine/aio/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /opt/app.jar
2 changes: 1 addition & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ services:
depends_on:
- activemq
transform-core-aio:
image: alfresco/alfresco-transform-core-aio:5.1.2
image: localhost/alfresco-transform-core-aio:latest
mem_limit: 1536m
environment:
JAVA_OPTS: >-
Expand Down

0 comments on commit 69f85b7

Please sign in to comment.