Skip to content

Commit

Permalink
OPSEXP-2724 Add T-Engine ImageMagick image Dockefile
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Jul 26, 2024
1 parent f2b253e commit 2ebd05c
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 1 deletion.
42 changes: 41 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group "default" {
targets = ["content_service", "enterprise-search", "ats"]
targets = ["content_service", "enterprise-search", "ats", "tengine"]
}

group "content_service" {
Expand All @@ -14,6 +14,10 @@ group "ats" {
targets = ["ats_trouter"]
}

group "tengine" {
targets = ["tengine_imagemagick"]
}

variable "LABEL_VENDOR" {
default = "Hyland Software, Inc."
}
Expand Down Expand Up @@ -252,3 +256,39 @@ target "ats_trouter" {
tags = ["localhost/alfresco-transform-router:latest"]
output = ["type=docker"]
}

variable "ALFRESCO_IMAGEMAGICK_GROUP_NAME" {
default = "Alfresco"
}

variable "ALFRESCO_IMAGEMAGICK_GROUP_ID" {
default = "1000"
}

variable "ALFRESCO_IMAGEMAGICK_USER_NAME" {
default = "imagemagick"
}

variable "ALFRESCO_IMAGEMAGICK_USER_ID" {
default = "33002"
}

target "tengine_imagemagick" {
dockerfile = "./tengine/imagemagick/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} Transform Engine Imagemagick"
"org.opencontainers.image.description" = "Alfresco Transform Engine Imagemagick"
}
tags = ["localhost/alfresco-imagemagick:latest"]
output = ["type=docker"]
}
20 changes: 20 additions & 0 deletions tengine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Runtime variables

Sets of variables configurable with your docker image

## imagemagick

```yaml

transform-core-imagemagick:
image: localhost/alfresco-imagemagick:YOUR-TAG
environment:
JAVA_OPTS:
ACTIVEMQ_URL: nio://activemq:61616
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.
30 changes: 30 additions & 0 deletions tengine/imagemagick/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM java_base

EXPOSE 8090

ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80
ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
ENV IMAGEMAGICK_RPM_PATH=tengine/imagemagick/imagemagick-distribution

ARG ALFRESCO_IMAGEMAGICK_GROUP_NAME
ARG ALFRESCO_IMAGEMAGICK_GROUP_ID
ARG ALFRESCO_IMAGEMAGICK_USER_NAME
ARG ALFRESCO_IMAGEMAGICK_USER_ID

ADD tengine/imagemagick/alfresco-transform-imagemagick*.jar /usr/bin/app.jar

RUN yum install -y $IMAGEMAGICK_DEP_RPM_URL && \
yum install -y ${IMAGEMAGICK_RPM_PATH}*-el8.rpm ${IMAGEMAGICK_RPM_PATH}*-el8-libs.rpm; \
yum clean all

RUN groupadd -g ${ALFRESCO_IMAGEMAGICK_GROUP_ID} ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} && \
useradd -u ${ALFRESCO_IMAGEMAGICK_USER_ID} -G ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} ${ALFRESCO_IMAGEMAGICK_USER_NAME} && \
chgrp ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} /usr/bin/app.jar

USER ${ALFRESCO_IMAGEMAGICK_USER_NAME}

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

COPY tengine/imagemagick/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
30 changes: 30 additions & 0 deletions tengine/imagemagick/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"artifacts": {
"acs23": [
{
"name": "imagemagick-distribution",
"version": "7.1.0-16-ci-10",
"path": "tengine/imagemagick",
"classifier": "-el8-libs.rpm",
"repository": "thirdparty",
"group": "org.imagemagick"
},
{
"name": "imagemagick-distribution",
"version": "7.1.0-16-ci-7",
"path": "tengine/imagemagick",
"classifier": "-el8.rpm",
"repository": "thirdparty",
"group": "org.imagemagick"
},
{
"name": "alfresco-transform-imagemagick",
"version": "5.1.3",
"path": "tengine/imagemagick",
"classifier": ".jar",
"repository": "releases",
"group": "org.alfresco"
}
]
}
}
3 changes: 3 additions & 0 deletions tengine/imagemagick/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /usr/bin/app.jar

0 comments on commit 2ebd05c

Please sign in to comment.