Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Sep 18, 2024
1 parent a408ee6 commit f79c5bc
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions share/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ USER root
EXPOSE 8000

RUN mkdir -p ${CATALINA_HOME}/shared/classes/alfresco/web-extension \
${CATALINA_HOME}/amps_share \
${CATALINA_HOME}/webapps/share/ \
${CATALINA_HOME}/alfresco-mmt/ \
/licenses
${CATALINA_HOME}/conf/Catalina/localhost

COPY entrypoint.sh ${CATALINA_HOME}/shared/classes/alfresco

Expand All @@ -20,32 +17,31 @@ ENV DISTDIR="/tmp/distribution"
RUN yum install -y unzip && \
unzip /tmp/*.zip -d ${DISTDIR} &&\
unzip ${DISTDIR}/alfresco*/web-server/webapps/share.war -d ${CATALINA_HOME}/webapps/share/ &&\
cp ${DISTDIR}/alfresco*/bin/* ${CATALINA_HOME}/alfresco-mmt/ &&\
cp -r ${DISTDIR}/alfresco*/amps ${CATALINA_HOME}/amps_share &&\
cp /tmp/amps/*.amp ${CATALINA_HOME}/amps_share &&\
cp -r ${DISTDIR}/alfresco*/amps/ /tmp/amps/ &&\
cp ${DISTDIR}/alfresco*/web-extension-samples/custom-slingshot-application-context.xml.sample ${CATALINA_HOME}/shared/classes/alfresco/web-extension &&\
cp ${DISTDIR}/alfresco*/web-extension-samples/smartfolders-amp-actions-config.xml ${CATALINA_HOME}/shared/classes/alfresco/web-extension &&\
cp /tmp/share-config-custom.xml ${CATALINA_HOME}/shared/classes/alfresco/web-extension &&\
rm -rf ${DISTDIR} /tmp &&\
cp ${DISTDIR}/alfresco*/web-server/conf/Catalina/localhost/share.xml ${CATALINA_HOME}/conf/Catalina/localhost &&\
sed -i 's|../modules/share|modules/share|' ${CATALINA_HOME}/conf/Catalina/localhost/share.xml &&\
sed -i "s/shared.loader=/shared.loader=\${catalina.base}\/shared\/classes/" ${CATALINA_HOME}/conf/catalina.properties &&\
chmod +x ${CATALINA_HOME}/shared/classes/alfresco/entrypoint.sh &&\
yum clean all && rm -rf /var/cache/yum

RUN java -jar ${CATALINA_HOME}/alfresco-mmt/alfresco-mmt*.jar install \
${CATALINA_HOME}/amps_share ${CATALINA_HOME}/webapps/share -directory -nobackup -force
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_GROUP_ID} --from=share_build ${CATALINA_HOME} ${CATALINA_HOME}
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/platform && \
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
Expand Down

0 comments on commit f79c5bc

Please sign in to comment.