-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPSEXP-2800 Add share component Dockerfile (#47)
- Loading branch information
Showing
13 changed files
with
999 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
ARG DISTRIB_NAME | ||
ARG DISTRIB_MAJOR | ||
FROM tomcat_base as share_build | ||
|
||
USER root | ||
EXPOSE 8000 | ||
|
||
RUN mkdir -p ${CATALINA_HOME}/shared/classes/alfresco/web-extension \ | ||
${CATALINA_HOME}/conf/Catalina/localhost | ||
|
||
COPY entrypoint.sh ${CATALINA_HOME}/shared/classes/alfresco | ||
|
||
ADD amps /tmp/amps | ||
ADD distribution /tmp/ | ||
ENV DISTDIR="/tmp/distribution" | ||
|
||
RUN yum install -y unzip | ||
RUN unzip /tmp/*.zip -d ${DISTDIR} | ||
RUN unzip ${DISTDIR}/alfresco*/web-server/webapps/share.war -d ${CATALINA_HOME}/webapps/share/ | ||
RUN cp -r ${DISTDIR}/alfresco*/amps/ /tmp/amps/ | ||
RUN cp /tmp/share-config-custom.xml ${CATALINA_HOME}/shared/classes/alfresco/web-extension | ||
RUN cp ${DISTDIR}/alfresco*/web-server/conf/Catalina/localhost/share.xml ${CATALINA_HOME}/conf/Catalina/localhost | ||
RUN sed -i 's|../modules/share|modules/share|' ${CATALINA_HOME}/conf/Catalina/localhost/share.xml | ||
RUN sed -i "s/shared.loader=/shared.loader=\${catalina.base}\/shared\/classes/" ${CATALINA_HOME}/conf/catalina.properties | ||
RUN chmod +x ${CATALINA_HOME}/shared/classes/alfresco/entrypoint.sh | ||
|
||
RUN java -jar ${DISTDIR}/alfresco*/bin/alfresco-mmt.jar install \ | ||
/tmp/amps/ ${CATALINA_HOME}/webapps/share -directory -nobackup -force | ||
|
||
FROM tomcat_base AS share-rhlike | ||
ARG ALFRESCO_SHARE_USER_ID | ||
ARG ALFRESCO_SHARE_GROUP_ID | ||
ARG ALFRESCO_SHARE_GROUP_NAME | ||
ARG ALFRESCO_SHARE_USER_NAME | ||
|
||
COPY --chown=${ALFRESCO_SHARE_USER_ID}:${ALFRESCO_SHARE_GROUP_ID} --from=share_build ${CATALINA_HOME} ${CATALINA_HOME} | ||
|
||
USER root | ||
RUN groupadd -g ${ALFRESCO_SHARE_GROUP_ID} ${ALFRESCO_SHARE_GROUP_NAME} && \ | ||
useradd -u ${ALFRESCO_SHARE_USER_ID} -g ${ALFRESCO_SHARE_GROUP_NAME} ${ALFRESCO_SHARE_USER_NAME} -G tomcat && \ | ||
mkdir -m 750 -p ${CATALINA_HOME}/modules/share && \ | ||
chgrp -R ${ALFRESCO_SHARE_GROUP_ID} ${CATALINA_HOME}/modules && \ | ||
yum install -y xmlstarlet && \ | ||
yum clean all && rm -rf /var/cache/yum | ||
|
||
FROM share-rhlike AS share-rockylinux9 | ||
|
||
FROM share-${DISTRIB_NAME}${DISTRIB_MAJOR} | ||
USER ${ALFRESCO_SHARE_USER_NAME} | ||
|
||
ENTRYPOINT ["/usr/local/tomcat/shared/classes/alfresco/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Alfresco share image | ||
|
||
## Description | ||
|
||
This Docker file is used to build an Alfresco share image. | ||
|
||
## Building the image | ||
|
||
Make sure all required artifacts are present in the build context `share/`. | ||
You can put them manually in the `share/` folder (for example if that's a | ||
custom module of yours), or use the script `./scripts/fetch-artifacts.sh` to | ||
download them from Alfresco's Nexus. | ||
|
||
Then, you can build the image from the root of this git repository with the | ||
following command: | ||
|
||
```bash | ||
docker buildx bake share | ||
``` | ||
|
||
## Running the image | ||
|
||
### Alfresco share configuration | ||
|
||
All preperties you would normally add in the alfresco-global.properties file can | ||
be added in the `JAVA_OPTS` environment variable to the container. | ||
|
||
For example, to set the database URL, you can use the following environment | ||
variable: | ||
|
||
```bash | ||
docker run -e JAVA_OPTS="-Dalfresco.host=localhost" \ | ||
alfresco-share:mytag | ||
``` | ||
|
||
Example set of variables for docker-compose file: | ||
|
||
```yaml | ||
|
||
alfresco-connector-ms365: | ||
image: localhost/alfresco-share:YOUR-TAG | ||
environment: | ||
JAVA_OPTS: "" | ||
REPO_HOST: alfresco | ||
REPO_PORT: 8080 | ||
CSRF_FILTER_REFERER: | ||
CSRF_FILTER_ORIGIN: | ||
USE_SSL: false | ||
|
||
``` | ||
|
||
- `JAVA_OPTS` - A set of properties that are picked up by the JVM inside the container | ||
- `REPO_HOST` - Share needs to know how to register itself with Alfresco. The default value is `localhost` | ||
- `REPO_PORT` - Share needs to know how to register itself with Alfresco. The default value is `8080` | ||
- `CSRF_FILTER_REFERER` - CSRF Referrer | ||
- `CSRF_FILTER_ORIGIN` - CSRF Origin | ||
- `USE_SSL` - Enables ssl use if set to `true`. The default value is `false` | ||
|
||
|
||
> If the image is meant to be used with the Alfresco Content Services Helm | ||
> chart, you can use other [higher level means of | ||
> configuration](https://github.com/Alfresco/alfresco-helm-charts/blob/main/charts/alfresco-share/README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Alfresco share AMPs | ||
|
||
Place here your Alfresco module Packages (AMPs) to be installed in the Alfresco | ||
share. | ||
|
||
AMP packages should have the `.amp` extension and stick to the Alfresco module | ||
packaging format as described in the [Alfresco | ||
documentation](https://docs.alfresco.com/content-services/latest/develop/extension-packaging/#alfresco-module-package-amp). | ||
|
||
The [in-process Alfresco | ||
SDK](https://docs.alfresco.com/content-services/latest/develop/sdk/) provides a | ||
way to build well structured AMPs. | ||
|
||
> Note that AMPs are not the recommanded way to extend Alfresco. You should | ||
> prefer using the Alfresco SDK to build your extensions as JARs even better, | ||
> use the [out-of-process Alfresco | ||
> SDK](https://docs.alfresco.com/content-services/latest/develop/oop-sdk/) to | ||
> build Docker images with your extensions. | ||
By default the `scripts/fetch-artifacts.sh` script will fetch the following AMPs from the Alfresco Nexus repository: | ||
|
||
* alfresco-googledrive-share | ||
|
||
You can replace those, remove them to keep only the ones you need or add more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"artifacts": { | ||
"acs23": [ | ||
{ | ||
"name": "alfresco-content-services-share-distribution", | ||
"version": "23.2.2", | ||
"path": "share/distribution", | ||
"classifier": ".zip", | ||
"group": "org.alfresco", | ||
"repository": "enterprise-releases" | ||
}, | ||
{ | ||
"name": "alfresco-googledrive-share", | ||
"version": "4.1.0", | ||
"path": "share/amps", | ||
"classifier": ".amp", | ||
"group": "org.alfresco.integrations", | ||
"repository": "releases" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Alfresco Content Services share distribution | ||
|
||
Place here the version of Alfresco Content Services share distribution you want to | ||
use in your Docker image. | ||
Distribution file must be a ZIP file with the expected structure of an Alfresco | ||
Content Services share distribution. | ||
|
||
```tree | ||
amps/ | ||
bin/ | ||
web-extension-samples/ | ||
web-server/ | ||
|_webapps/ | ||
|_conf/ | ||
|_Catalina/ | ||
|_localhost/ | ||
``` | ||
Do changes to `share-config-custom.xml` according to your needs. |
Oops, something went wrong.