Skip to content

Commit

Permalink
rebase and review
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Jul 26, 2024
2 parents 3502b62 + 312f407 commit 2b474d4
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 34 deletions.
31 changes: 31 additions & 0 deletions ats/trouter/README.md → ats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,34 @@ transform-router:
- `LIBREOFFICE_URL` - The URL for the LibreOffice service
- `TIKA_URL` - The URL for the Tika service
- `MISC_URL` - The URL for Mics service

## sfs

```yaml

shared-file-store:
image: localhost/alfresco-shared-file-store:YOUR-TAG
mem_limit: 512m
environment:
JAVA_OPTS:
scheduler.content.age.millis: 86400000
scheduler.cleanup.interval: 86400000
scheduler.contract.path: /tmp/scheduler.json
fileStorePath: /tmp/Alfresco
ports:
- "8099:8099"
volumes:
- shared-file-store-volume:/tmp/Alfresco/sfs
volumes:
shared-file-store-volume:
driver_opts:
type: tmpfs
device: tmpfs

```

- `JAVA_OPTS` - Additional java options
- `scheduler.content.age.millis` - Content retention period. The default value is `86400000`
- `scheduler.cleanup.interval` - Cleanup Scheduler interval. The default value is `86400000`
- `scheduler.contract.path` - Cleanup Scheduler contract path. The default value is `/tmp/scheduler.json`
- `fileStorePath` - Shared File Store content storing path. The default value is `/tmp/Alfresco`
29 changes: 29 additions & 0 deletions ats/sfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM java_base

EXPOSE 8099
ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80

ARG ALFRESCO_SFS_GROUP_NAME
ARG ALFRESCO_SFS_GROUP_ID
ARG ALFRESCO_SFS_USER_NAME
ARG ALFRESCO_SFS_USER_ID

ADD ats/sfs/alfresco-shared-file-store-controller*.jar /opt/app.jar

# Set default environment args
ARG FILE_STORE_DIR=/tmp/Alfresco

RUN mkdir -p ${FILE_STORE_DIR} && \
groupadd -g ${ALFRESCO_SFS_GROUP_ID} ${ALFRESCO_SFS_GROUP_NAME} && \
useradd -u ${ALFRESCO_SFS_USER_ID} -G ${ALFRESCO_SFS_GROUP_NAME} ${ALFRESCO_SFS_USER_NAME} && \
chgrp -R ${ALFRESCO_SFS_GROUP_NAME} ${FILE_STORE_DIR} && \
chmod g+rwx ${FILE_STORE_DIR} && \
chgrp ${ALFRESCO_SFS_GROUP_NAME} /opt/app.jar

USER ${ALFRESCO_SFS_USER_NAME}

HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1m \
CMD curl -f http://localhost:8099/actuator/health || exit 1

COPY ats/sfs/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
14 changes: 14 additions & 0 deletions ats/sfs/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-shared-file-store-controller",
"version": "4.1.3",
"path": "ats/sfs",
"classifier": ".jar",
"repository": "enterprise-releases",
"group": "org.alfresco"
}
]
}
}
3 changes: 3 additions & 0 deletions ats/sfs/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 /opt/app.jar
58 changes: 35 additions & 23 deletions 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", "tengine"]
targets = ["content_service", "enterprise-search", "ats", "tengines"]
}

group "content_service" {
Expand All @@ -11,10 +11,10 @@ group "enterprise-search" {
}

group "ats" {
targets = ["ats_trouter"]
targets = ["ats_trouter", "ats_sfs"]
}

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

Expand Down Expand Up @@ -70,11 +70,11 @@ variable "LIVEINDEXING" {
default = "metadata"
}

variable "ALFRESCO_REPO_GROUP_ID" {
variable "ALFRESCO_GROUP_ID" {
default = "1000"
}

variable "ALFRESCO_REPO_GROUP_NAME" {
variable "ALFRESCO_GROUP_NAME" {
default = "alfresco"
}

Expand Down Expand Up @@ -170,8 +170,8 @@ target "repository" {
tomcat_base = "target:tomcat_base"
}
args = {
ALFRESCO_REPO_GROUP_ID = "${ALFRESCO_REPO_GROUP_ID}"
ALFRESCO_REPO_GROUP_NAME = "${ALFRESCO_REPO_GROUP_NAME}"
ALFRESCO_REPO_GROUP_ID = "${ALFRESCO_GROUP_ID}"
ALFRESCO_REPO_GROUP_NAME = "${ALFRESCO_GROUP_NAME}"
ALFRESCO_REPO_USER_ID = "${ALFRESCO_REPO_USER_ID}"
ALFRESCO_REPO_USER_NAME = "${ALFRESCO_REPO_USER_NAME}"
}
Expand Down Expand Up @@ -221,14 +221,6 @@ target "search_liveindexing" {
output = ["type=docker"]
}

variable "ALFRESCO_TROUTER_GROUP_NAME" {
default = "Alfresco"
}

variable "ALFRESCO_TROUTER_GROUP_ID" {
default = "1000"
}

variable "ALFRESCO_TROUTER_USER_NAME" {
default = "trouter"
}
Expand All @@ -244,8 +236,8 @@ target "ats_trouter" {
java_base = "target:java_base"
}
args = {
ALFRESCO_TROUTER_GROUP_NAME = "${ALFRESCO_TROUTER_GROUP_NAME}"
ALFRESCO_TROUTER_GROUP_ID = "${ALFRESCO_TROUTER_GROUP_ID}"
ALFRESCO_TROUTER_GROUP_NAME = "${ALFRESCO_GROUP_NAME}"
ALFRESCO_TROUTER_GROUP_ID = "${ALFRESCO_GROUP_ID}"
ALFRESCO_TROUTER_USER_NAME = "${ALFRESCO_TROUTER_USER_NAME}"
ALFRESCO_TROUTER_USER_ID = "${ALFRESCO_TROUTER_USER_ID}"
}
Expand All @@ -257,12 +249,32 @@ target "ats_trouter" {
output = ["type=docker"]
}

variable "ALFRESCO_IMAGEMAGICK_GROUP_NAME" {
default = "Alfresco"
variable "ALFRESCO_SFS_USER_NAME" {
default = "sfs"
}

variable "ALFRESCO_IMAGEMAGICK_GROUP_ID" {
default = "1000"
variable "ALFRESCO_SFS_USER_ID" {
default = "33030"
}

target "ats_sfs" {
dockerfile = "./ats/sfs/Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
}
args = {
ALFRESCO_SFS_GROUP_NAME = "${ALFRESCO_GROUP_NAME}"
ALFRESCO_SFS_GROUP_ID = "${ALFRESCO_GROUP_ID}"
ALFRESCO_SFS_USER_NAME = "${ALFRESCO_SFS_USER_NAME}"
ALFRESCO_SFS_USER_ID = "${ALFRESCO_SFS_USER_ID}"
}
labels = {
"org.opencontainers.image.title" = "${PRODUCT_LINE} ATS Shared File Store"
"org.opencontainers.image.description" = "Alfresco Transform Service ATS Shared File Store"
}
tags = ["localhost/alfresco-shared-file-store:latest"]
output = ["type=docker"]
}

variable "ALFRESCO_IMAGEMAGICK_USER_NAME" {
Expand All @@ -280,8 +292,8 @@ target "tengine_imagemagick" {
java_base = "target:java_base"
}
args = {
ALFRESCO_IMAGEMAGICK_GROUP_NAME = "${ALFRESCO_IMAGEMAGICK_GROUP_NAME}"
ALFRESCO_IMAGEMAGICK_GROUP_ID = "${ALFRESCO_IMAGEMAGICK_GROUP_ID}"
ALFRESCO_IMAGEMAGICK_GROUP_NAME = "${ALFRESCO_GROUP_NAME}"
ALFRESCO_IMAGEMAGICK_GROUP_ID = "${ALFRESCO_GROUP_ID}"
ALFRESCO_IMAGEMAGICK_USER_NAME = "${ALFRESCO_IMAGEMAGICK_USER_NAME}"
ALFRESCO_IMAGEMAGICK_USER_ID = "${ALFRESCO_IMAGEMAGICK_USER_ID}"
}
Expand Down
5 changes: 1 addition & 4 deletions docker-compose/docker-compose-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ services:
depends_on:
- activemq
shared-file-store:
image: quay.io/alfresco/alfresco-shared-file-store:4.1.2
image: localhost/alfresco-shared-file-store:latest
mem_limit: 512m
environment:
JAVA_OPTS: >-
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
scheduler.content.age.millis: 86400000
scheduler.cleanup.interval: 86400000
ports:
Expand Down
5 changes: 1 addition & 4 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ services:
depends_on:
- activemq
shared-file-store:
image: quay.io/alfresco/alfresco-shared-file-store:4.1.2
image: localhost/alfresco-shared-file-store:latest
mem_limit: 512m
environment:
JAVA_OPTS: >-
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
scheduler.content.age.millis: 86400000
scheduler.cleanup.interval: 86400000
ports:
Expand Down
7 changes: 4 additions & 3 deletions tengine/imagemagick/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ 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
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
ADD ${IMAGEMAGICK_RPM_PATH} /tmp/

RUN yum install -y $IMAGEMAGICK_DEP_RPM_URL && \
yum install -y ${IMAGEMAGICK_RPM_PATH}*-el8.rpm ${IMAGEMAGICK_RPM_PATH}*-el8-libs.rpm; \
yum install -y /tmp/*-el8.rpm /tmp/*-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} && \
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}
Expand Down

0 comments on commit 2b474d4

Please sign in to comment.