mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
move AGS API war to multistage build (#912)
This commit is contained in:
@@ -1,4 +1,17 @@
|
|||||||
### Apply AGS community repo AMP to ACS image
|
# BUILD STAGE AGS
|
||||||
|
FROM debian:11-slim AS AGSBUILDER
|
||||||
|
|
||||||
|
RUN export DEBIAN_FRONTEND=noninteractive; \
|
||||||
|
apt-get update -qqy && apt-get -yqq install unzip && \
|
||||||
|
mkdir -p /build/gs-api-explorer
|
||||||
|
|
||||||
|
### Copy the AGS war from the local context
|
||||||
|
COPY target/gs-api-explorer-*.war /build
|
||||||
|
|
||||||
|
RUN unzip -q /build/gs-api-explorer-*.war -d /build/gs-api-explorer && \
|
||||||
|
chmod -R g-w,o= /build
|
||||||
|
|
||||||
|
# ACTUAL IMAGE
|
||||||
FROM alfresco/alfresco-community-repo-base:${image.tag}
|
FROM alfresco/alfresco-community-repo-base:${image.tag}
|
||||||
|
|
||||||
# Alfresco user does not have permissions to modify webapps or configuration. Switch to root.
|
# Alfresco user does not have permissions to modify webapps or configuration. Switch to root.
|
||||||
@@ -13,18 +26,13 @@ RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install \
|
|||||||
/usr/local/tomcat/amps \
|
/usr/local/tomcat/amps \
|
||||||
/usr/local/tomcat/webapps/alfresco -directory -nobackup
|
/usr/local/tomcat/webapps/alfresco -directory -nobackup
|
||||||
|
|
||||||
### Copy gs-api-explorer war into webapps folder
|
### Copy gs-api-explorer
|
||||||
COPY target/gs-api-explorer-*.war /usr/local/tomcat/webapps/
|
COPY --chown=root:Alfresco --from=AGSBUILDER /build/gs-api-explorer /usr/local/tomcat/webapps/gs-api-explorer
|
||||||
|
|
||||||
### Unpack gs-api-explorer.war
|
|
||||||
RUN mkdir /usr/local/tomcat/webapps/gs-api-explorer && cd /usr/local/tomcat/webapps/gs-api-explorer && \
|
|
||||||
jar -xvf /usr/local/tomcat/webapps/gs-api-explorer-*.war && rm -f /usr/local/tomcat/webapps/gs-api-explorer-*.war
|
|
||||||
|
|
||||||
# All files in the tomcat folder must be owned by root user and Alfresco group as mentioned in the parent Dockerfile
|
# All files in the tomcat folder must be owned by root user and Alfresco group as mentioned in the parent Dockerfile
|
||||||
RUN chgrp -R Alfresco /usr/local/tomcat && \
|
RUN chgrp -R Alfresco /usr/local/tomcat && \
|
||||||
find /usr/local/tomcat/webapps -type d -exec chmod 0750 {} \; && \
|
find /usr/local/tomcat/webapps -type d -exec chmod 0750 {} \; && \
|
||||||
find /usr/local/tomcat/webapps -type f -exec chmod 0640 {} \; && \
|
find /usr/local/tomcat/webapps -type f -exec chmod 0640 {} \;
|
||||||
chmod -R g+r /usr/local/tomcat/webapps
|
|
||||||
|
|
||||||
# Switching back to alfresco user after having added amps files to run the container as non-root
|
# Switching back to alfresco user after having added amps files to run the container as non-root
|
||||||
USER alfresco
|
USER alfresco
|
||||||
|
Reference in New Issue
Block a user