From ade0b3eddcf721ed34605dccfdabfbd1f83b5a68 Mon Sep 17 00:00:00 2001 From: "Douglas C. R. Paes" Date: Wed, 1 May 2019 15:15:50 -0300 Subject: [PATCH 1/6] All config moved from file alfresco-global.properties into Dockerfile in order to avoid replacing the ootb file. This will fix problems like issue 566, where the original properties are simply removed by the file replacement. --- .../src/main/docker/Dockerfile | 65 ++++++++++++++- .../main/docker/alfresco-global.properties | 82 ------------------- 2 files changed, 63 insertions(+), 84 deletions(-) delete mode 100644 archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/alfresco-global.properties diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile index 0acd7c64..2d31a5b0 100644 --- a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile +++ b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile @@ -10,9 +10,70 @@ COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps/ RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \ $TOMCAT_DIR/amps $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force -COPY alfresco-global.properties $TOMCAT_DIR/shared/classes/alfresco-global.properties COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension # Copy Dockerfile to avoid an error if no license file exists -COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/ \ No newline at end of file +COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/ + +# Alfresco configuration for running locally with PostgreSQL Database +RUN echo -e '\n\ +# Alfresco Repo Webapp (alfresco.war) context, ports etc\n\ +alfresco.context=alfresco\n\ +alfresco.host=localhost\n\ +alfresco.port=8080\n\ +alfresco.protocol=http\n\ +\n\ +# Alfresco Share Webapp (share.war) context, ports etc\n\ +share.context=share\n\ +share.host=localhost\n\ +share.port=8180\n\ +share.protocol=http\n\ +\n\ +# Don''t try and recover any index\n\ +index.recovery.mode=NONE\n\ +\n\ +# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date\n\ +# See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597\n\ +# If you want to enable them (and so full WQS functionality), please also set index.subsystem.name=lucene\n\ +wcmqs.dynamicCollectionProcessor.schedule=0 30 2 * * ? 2060\n\ +wcmqs.feedbackProcessor.schedule=0 40 2 * * ? 2060\n\ +wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060\n\ +\n\ +# Fail or not when there are node integrity checker errors\n\ +integrity.failOnError=true\n\ +\n\ +# Fail or not when there are node integrity checker errors\n\ +integrity.failOnError=true\n\ +\n\ +# Alfresco Repository PostgreSQL Database configuration.\n\ +db.driver=org.postgresql.Driver\n\ +\n\ +# This Alfresco Platform Configuration file should be used for custom properties that are introduced by this module.\n\ +# Define default values for all properties here.\n\ +# System Administrators can override these values in environment specific configurations in\n\ +# alfresco/tomcat/shared/classes/alfresco-global.properties.\n\ +#\n\ +index.subsystem.name=solr6\n\ +solr.host=${rootArtifactId}-ass\n\ +solr.port=8983\n\ +solr.secureComms=none\n\ +\n\ +db.username=alfresco\n\ +db.password=alfresco\n\ +db.pool.initial=10\n\ +db.pool.max=100\n\ +\n\ +db.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco\n\ +\n\ +# File servers related properties\n\ +# For local runs we disable CIFS and FTP\n\ +cifs.enabled=false\n\ +ftp.enabled=false\n\ +\n\ +csrf.filter.enabled=false\n\ +\n\ +# Embedded broker without persistence\n\ +messaging.broker.url=vm://localhost?broker.persistent=false\n\ +\n\ +' >> /usr/local/tomcat/shared/classes/alfresco-global.properties \ No newline at end of file diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/alfresco-global.properties b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/alfresco-global.properties deleted file mode 100644 index aa3f95a2..00000000 --- a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/alfresco-global.properties +++ /dev/null @@ -1,82 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# RUN TIME PROPERTIES -# ------------------- - -# -# Alfresco configuration for running locally with PostgreSQL Database -# -# Configuration when running Tomcat embedded from Maven. -# Property values from the POM but it can also be edited here. -# - -# Alfresco Repo Webapp (alfresco.war) context, ports etc -alfresco.context=alfresco -alfresco.host=localhost -alfresco.port=8080 -alfresco.protocol=http - -# Alfresco Share Webapp (share.war) context, ports etc -share.context=share -share.host=localhost -share.port=8180 -share.protocol=http - -# Don't try and recover any index -index.recovery.mode=NONE - -# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date -# See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597 -# If you want to enable them (and so full WQS functionality), please also set index.subsystem.name=lucene -wcmqs.dynamicCollectionProcessor.schedule=0 30 2 * * ? 2060 -wcmqs.feedbackProcessor.schedule=0 40 2 * * ? 2060 -wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060 - -# Fail or not when there are node integrity checker errors -integrity.failOnError=true - -# Alfresco Repository PostgreSQL Database configuration. -# The PostgreSQL Driver is brought in via the tomcat7-maven-plugin as a dependency. -db.driver=org.postgresql.Driver - -# This Alfresco Platform Configuration file should be used for custom properties that are introduced by this module. -# Define default values for all properties here. -# System Administrators can override these values in environment specific configurations in -# alfresco/tomcat/shared/classes/alfresco-global.properties. -# -index.subsystem.name=solr6 -solr.host=${rootArtifactId}-ass -solr.port=8983 -solr.secureComms=none - -db.username=alfresco -db.password=alfresco -db.pool.initial=10 -db.pool.max=100 - -db.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco - -# File servers related properties -# For local runs we disable CIFS and FTP -cifs.enabled=false -ftp.enabled=false - -csrf.filter.enabled=false - -# Embedded broker without persistence -messaging.broker.url=vm://localhost?broker.persistent=false \ No newline at end of file From 979707510f71a6fcd577f9890d4d643605ece457 Mon Sep 17 00:00:00 2001 From: "Douglas C. R. Paes" Date: Wed, 1 May 2019 15:17:02 -0300 Subject: [PATCH 2/6] As the Dockerfile is created when the project is created by using the archetype, some of it's properties have to be filtered by Maven. So the filesets were changed accordingly. --- .../src/main/resources/META-INF/maven/archetype-metadata.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/alfresco-platform-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index e4f4ad8b..5aca7f26 100644 --- a/archetypes/alfresco-platform-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/archetypes/alfresco-platform-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -27,7 +27,6 @@ src/main/docker license/** - Dockerfile disable-webscript-caching-context.xml @@ -38,10 +37,10 @@ src/main/docker **/*.properties + Dockerfile license/** - Dockerfile disable-webscript-caching-context.xml From d42af924c0708d0338be360e45547aabde40ab29 Mon Sep 17 00:00:00 2001 From: "Douglas C. R. Paes" Date: Wed, 1 May 2019 15:20:51 -0300 Subject: [PATCH 3/6] All config moved from file alfresco-global.properties into Dockerfile in order to avoid replacing the ootb file. This will fix problems like issue 566, where the original properties are simply removed by the file replacement. --- .../src/main/docker/Dockerfile | 64 ++++++++++++++- .../main/docker/alfresco-global.properties | 82 ------------------- 2 files changed, 63 insertions(+), 83 deletions(-) delete mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/alfresco-global.properties diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/Dockerfile b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/Dockerfile index 0acd7c64..c84ad169 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/Dockerfile +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/Dockerfile @@ -15,4 +15,66 @@ COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension # Copy Dockerfile to avoid an error if no license file exists -COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/ \ No newline at end of file +COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/ + +# Alfresco configuration for running locally with PostgreSQL Database +RUN echo -e '\n\ +# Alfresco Repo Webapp (alfresco.war) context, ports etc\n\ +alfresco.context=alfresco\n\ +alfresco.host=localhost\n\ +alfresco.port=8080\n\ +alfresco.protocol=http\n\ +\n\ +# Alfresco Share Webapp (share.war) context, ports etc\n\ +share.context=share\n\ +share.host=localhost\n\ +share.port=8180\n\ +share.protocol=http\n\ +\n\ +# Don''t try and recover any index\n\ +index.recovery.mode=NONE\n\ +\n\ +# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date\n\ +# See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597\n\ +# If you want to enable them (and so full WQS functionality), please also set index.subsystem.name=lucene\n\ +wcmqs.dynamicCollectionProcessor.schedule=0 30 2 * * ? 2060\n\ +wcmqs.feedbackProcessor.schedule=0 40 2 * * ? 2060\n\ +wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060\n\ +\n\ +# Fail or not when there are node integrity checker errors\n\ +integrity.failOnError=true\n\ +\n\ +# Fail or not when there are node integrity checker errors\n\ +integrity.failOnError=true\n\ +\n\ +# Alfresco Repository PostgreSQL Database configuration.\n\ +db.driver=org.postgresql.Driver\n\ +\n\ +# This Alfresco Platform Configuration file should be used for custom properties that are introduced by this module.\n\ +# Define default values for all properties here.\n\ +# System Administrators can override these values in environment specific configurations in\n\ +# alfresco/tomcat/shared/classes/alfresco-global.properties.\n\ +#\n\ +index.subsystem.name=solr6\n\ +solr.host=${rootArtifactId}-ass\n\ +solr.port=8983\n\ +solr.secureComms=none\n\ +\n\ +db.username=alfresco\n\ +db.password=alfresco\n\ +db.pool.initial=10\n\ +db.pool.max=100\n\ +\n\ +db.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco\n\ +\n\ +# File servers related properties\n\ +# For local runs we disable CIFS and FTP\n\ +cifs.enabled=false\n\ +ftp.enabled=false\n\ +\n\ +csrf.filter.enabled=false\n\ +\n\ +# Embedded broker without persistence\n\ +messaging.broker.url=vm://localhost?broker.persistent=false\n\ +\n\ +' >> /usr/local/tomcat/shared/classes/alfresco-global.properties \ No newline at end of file diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/alfresco-global.properties b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/alfresco-global.properties deleted file mode 100644 index aa3f95a2..00000000 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/alfresco-global.properties +++ /dev/null @@ -1,82 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# RUN TIME PROPERTIES -# ------------------- - -# -# Alfresco configuration for running locally with PostgreSQL Database -# -# Configuration when running Tomcat embedded from Maven. -# Property values from the POM but it can also be edited here. -# - -# Alfresco Repo Webapp (alfresco.war) context, ports etc -alfresco.context=alfresco -alfresco.host=localhost -alfresco.port=8080 -alfresco.protocol=http - -# Alfresco Share Webapp (share.war) context, ports etc -share.context=share -share.host=localhost -share.port=8180 -share.protocol=http - -# Don't try and recover any index -index.recovery.mode=NONE - -# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date -# See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597 -# If you want to enable them (and so full WQS functionality), please also set index.subsystem.name=lucene -wcmqs.dynamicCollectionProcessor.schedule=0 30 2 * * ? 2060 -wcmqs.feedbackProcessor.schedule=0 40 2 * * ? 2060 -wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060 - -# Fail or not when there are node integrity checker errors -integrity.failOnError=true - -# Alfresco Repository PostgreSQL Database configuration. -# The PostgreSQL Driver is brought in via the tomcat7-maven-plugin as a dependency. -db.driver=org.postgresql.Driver - -# This Alfresco Platform Configuration file should be used for custom properties that are introduced by this module. -# Define default values for all properties here. -# System Administrators can override these values in environment specific configurations in -# alfresco/tomcat/shared/classes/alfresco-global.properties. -# -index.subsystem.name=solr6 -solr.host=${rootArtifactId}-ass -solr.port=8983 -solr.secureComms=none - -db.username=alfresco -db.password=alfresco -db.pool.initial=10 -db.pool.max=100 - -db.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco - -# File servers related properties -# For local runs we disable CIFS and FTP -cifs.enabled=false -ftp.enabled=false - -csrf.filter.enabled=false - -# Embedded broker without persistence -messaging.broker.url=vm://localhost?broker.persistent=false \ No newline at end of file From 3ab89ad26ff0344c4ea0b2cc426e0c1e65423928 Mon Sep 17 00:00:00 2001 From: "Douglas C. R. Paes" Date: Wed, 1 May 2019 15:20:57 -0300 Subject: [PATCH 4/6] As the Dockerfile is created when the project is created by using the archetype, some of it's properties have to be filtered by Maven. So the filesets were changed accordingly. --- .../src/main/resources/META-INF/maven/archetype-metadata.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index d76717bd..62ff1fff 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -124,7 +124,6 @@ src/main/docker license/** - Dockerfile disable-webscript-caching-context.xml @@ -135,10 +134,10 @@ src/main/docker **/*.properties + Dockerfile license/** - Dockerfile disable-webscript-caching-context.xml From 7b87aaf8407b59d4b015def2125d1abd83795a09 Mon Sep 17 00:00:00 2001 From: "Douglas C. R. Paes" Date: Mon, 6 May 2019 11:49:05 -0300 Subject: [PATCH 5/6] Update Dockerfile Duplicated lines removal --- .../src/main/docker/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/Dockerfile b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/Dockerfile index c84ad169..e7c295be 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/Dockerfile +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/src/main/docker/Dockerfile @@ -44,9 +44,6 @@ wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060\n\ # Fail or not when there are node integrity checker errors\n\ integrity.failOnError=true\n\ \n\ -# Fail or not when there are node integrity checker errors\n\ -integrity.failOnError=true\n\ -\n\ # Alfresco Repository PostgreSQL Database configuration.\n\ db.driver=org.postgresql.Driver\n\ \n\ @@ -77,4 +74,4 @@ csrf.filter.enabled=false\n\ # Embedded broker without persistence\n\ messaging.broker.url=vm://localhost?broker.persistent=false\n\ \n\ -' >> /usr/local/tomcat/shared/classes/alfresco-global.properties \ No newline at end of file +' >> /usr/local/tomcat/shared/classes/alfresco-global.properties From 3f8ee2afa4359151e87e016d7c78443813d42859 Mon Sep 17 00:00:00 2001 From: "Douglas C. R. Paes" Date: Mon, 6 May 2019 11:51:04 -0300 Subject: [PATCH 6/6] Update Dockerfile Duplicated lines removal --- .../resources/archetype-resources/src/main/docker/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile index 2d31a5b0..6dc2664a 100644 --- a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile +++ b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile @@ -43,9 +43,6 @@ wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060\n\ # Fail or not when there are node integrity checker errors\n\ integrity.failOnError=true\n\ \n\ -# Fail or not when there are node integrity checker errors\n\ -integrity.failOnError=true\n\ -\n\ # Alfresco Repository PostgreSQL Database configuration.\n\ db.driver=org.postgresql.Driver\n\ \n\ @@ -76,4 +73,4 @@ csrf.filter.enabled=false\n\ # Embedded broker without persistence\n\ messaging.broker.url=vm://localhost?broker.persistent=false\n\ \n\ -' >> /usr/local/tomcat/shared/classes/alfresco-global.properties \ No newline at end of file +' >> /usr/local/tomcat/shared/classes/alfresco-global.properties