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-2723 Add ATS SFS image Dockerfile #8

Merged
merged 5 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
50 changes: 35 additions & 15 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ group "enterprise-search" {
}

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

variable "LABEL_VENDOR" {
Expand Down Expand Up @@ -66,11 +66,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 @@ -166,8 +166,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 @@ -217,14 +217,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 @@ -240,8 +232,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 @@ -252,3 +244,31 @@ target "ats_trouter" {
tags = ["localhost/alfresco-transform-router:latest"]
output = ["type=docker"]
}

variable "ALFRESCO_SFS_USER_NAME" {
default = "sfs"
}

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"]
}
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