Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-2727 Add T-engine pdf-renderer image Dockerfile #19

Merged
merged 8 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]

- name: Setup nexus authentication
run: |
echo "machine nexus.alfresco.com" >> ~/.netrc
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist
*.jar
*.rpm
*.gz
*.tgz
30 changes: 29 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ group "ats" {
}

group "tengines" {
targets = ["tengine_libreoffice", "tengine_imagemagick"]
targets = ["tengine_libreoffice", "tengine_imagemagick", "tengine_pdfrenderer"]
}

variable "LABEL_VENDOR" {
Expand Down Expand Up @@ -332,3 +332,31 @@ target "tengine_libreoffice" {
tags = ["localhost/alfresco-libreoffice:latest"]
output = ["type=docker"]
}

variable "ALFRESCO_PDFRENDERER_USER_NAME" {
default = "pdf"
}

variable "ALFRESCO_PDFRENDERER_USER_ID" {
default = "33001"
}

target "tengine_pdfrenderer" {
dockerfile = "./tengine/pdfrenderer/Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
}
args = {
ALFRESCO_PDFRENDERER_GROUP_NAME = "${ALFRESCO_GROUP_NAME}"
ALFRESCO_PDFRENDERER_GROUP_ID = "${ALFRESCO_GROUP_ID}"
ALFRESCO_PDFRENDERER_USER_NAME = "${ALFRESCO_PDFRENDERER_USER_NAME}"
ALFRESCO_PDFRENDERER_USER_ID = "${ALFRESCO_PDFRENDERER_USER_ID}"
}
labels = {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine PDF Renderer"
"org.opencontainers.image.description" = "Alfresco Transform Engine PDF Renderer"
}
tags = ["localhost/alfresco-pdf-renderer:latest"]
output = ["type=docker"]
}
29 changes: 29 additions & 0 deletions tengine/pdfrenderer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM java_base

ENV PDFRENDERER_COMMON_PATH=tengine/pdfrenderer
ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80

EXPOSE 8090

ARG ALFRESCO_PDFRENDERER_GROUP_NAME
ARG ALFRESCO_PDFRENDERER_GROUP_ID
ARG ALFRESCO_PDFRENDERER_USER_NAME
ARG ALFRESCO_PDFRENDERER_USER_ID

RUN --mount=type=bind,source=${PDFRENDERER_COMMON_PATH},target=/dist \
tar xzf /dist/*.tgz -C /usr/bin && \
yum clean all

ADD ${PDFRENDERER_COMMON_PATH}/alfresco-transform-pdf-renderer*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_PDFRENDERER_GROUP_ID} ${ALFRESCO_PDFRENDERER_GROUP_NAME} && \
useradd -u ${ALFRESCO_PDFRENDERER_USER_ID} -g ${ALFRESCO_PDFRENDERER_GROUP_NAME} ${ALFRESCO_PDFRENDERER_USER_NAME} && \
chgrp ${ALFRESCO_PDFRENDERER_GROUP_NAME} /opt/app.jar

USER ${ALFRESCO_PDFRENDERER_USER_NAME}

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

COPY ${PDFRENDERER_COMMON_PATH}/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
22 changes: 22 additions & 0 deletions tengine/pdfrenderer/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

## -pdf-renderer

```yaml

transform-core-pdf-renderer:
image: localhost/alfresco-pdf-renderer: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.
22 changes: 22 additions & 0 deletions tengine/pdfrenderer/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-pdf-renderer",
"version": "1.2",
"path": "tengine/pdfrenderer",
"classifier": "-linux.tgz",
"repository": "releases",
"group": "org.alfresco"
},
{
"name": "alfresco-transform-pdf-renderer",
"version": "5.1.3",
"path": "tengine/pdfrenderer",
"classifier": ".jar",
"repository": "releases",
"group": "org.alfresco"
}
]
}
}
2 changes: 2 additions & 0 deletions tengine/pdfrenderer/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