<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: What is the &amp;quot;Correct&amp;quot; way to set values in alfresco-global.properties with docker-comp in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126080#M34348</link>
    <description>&lt;P&gt;Ofcourse it won't. You have to update those scripts. These are new commands that won't be there in basic script you get. What you get with sdk is generally for development purposes only.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;You have to update "run.sh" something like:&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;case "$1" in
  build_start_dev)
    down_dev
    build
    start_dev
    tail
    ;;
&lt;BR /&gt;.....&lt;BR /&gt;....
	
down_dev() {
    if [ -f "$COMPOSE_FILE_PATH" ]; then
	docker-compose -f "$COMPOSE_FILE_PATH" --env-file .env.dev down
    fi
}

start_dev() {
    #create volumes
	...
	....
	
	#Start
	docker-compose -f "$COMPOSE_FILE_PATH" --env-file .env.dev up
...
}&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Oct 2021 13:02:17 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2021-10-26T13:02:17Z</dc:date>
    <item>
      <title>What is the "Correct" way to set values in alfresco-global.properties with docker-compose?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126077#M34345</link>
      <description>&lt;P&gt;I am using the Alfresco SDK,&amp;nbsp; and everything seems to be working fine.&amp;nbsp; I now need to move my stack from dev to test.&amp;nbsp; So all of my hard coded values in the alfresco-platform-docker/src/main/docker/alfresco-global.properties need to change.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know I could just write a script that switches out files before deploying,&amp;nbsp; but I know that's not "right"&lt;/P&gt;&lt;P&gt;I want to be able to set these as environment variables that get injected at deploy time.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any way to do this?&lt;/P&gt;&lt;P&gt;*******&amp;nbsp; Update&lt;/P&gt;&lt;P&gt;I found that adding properties under different profiles in the pom works fine, just build with the right profile and done.&amp;nbsp; But again,&amp;nbsp; I am asking for what alfresco considers the "correct" way&lt;/P&gt;</description>
      <pubDate>Sat, 23 Oct 2021 22:54:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126077#M34345</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2021-10-23T22:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: What is the "Correct" way to set values in alfresco-global.properties with docker-comp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126078#M34346</link>
      <description>&lt;P&gt;In my opinion the better way is to use&amp;nbsp;&lt;SPAN&gt;"JAVA_OPTS" (JVM runtime parameters) to set environment specific properties.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Building artificats per environment&amp;nbsp;defeats the purpose of "&lt;A href="https://medium.com/buildit/build-once-deploy-everywhere-part-1-706d7affaf0f" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;U&gt;build once and deploy everywhere&lt;/U&gt;&lt;/A&gt;" approach.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Even alfresco's base image has empty alfresco-global.properties and all properties are set via JVM params. See the example here:&amp;nbsp;&lt;A href="https://github.com/Alfresco/acs-deployment/blob/master/docker-compose/community-docker-compose.yml#L26" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/Alfresco/acs-deployment/blob/master/docker-compose/community-docker-compose.yml#L26&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;For example setting db properties per environment:&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;U&gt;Dev&lt;/U&gt;:&lt;/STRONG&gt;&lt;BR /&gt;JAVA_OPTS: "
   -Ddb.username=alfresco_dev
   -Ddb.password=alfresco_Dev
   -Ddb.url=jdbc:postgresql://dev.alfresco.db:5432/alfresco          
   "&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;QA&lt;/U&gt;:&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;JAVA_OPTS: "-Ddb.username=alfresco_qa &lt;BR /&gt;  -Ddb.password=alfresco_qa&lt;BR /&gt;  -Ddb.url=jdbc:postgresql://qa.alfresco.db:5432/alfresco &lt;BR /&gt;"&lt;/PRE&gt;
&lt;P&gt;The above example requires you to have environemt specific docker-compose.yml file. On the same lines there is another better way, you would have one docker-compose.yml but you can use '&lt;A href="https://docs.docker.com/compose/environment-variables/#using-the---env-file--option" target="_self" rel="nofollow noopener noreferrer"&gt;environment-file (--env-file)&lt;/A&gt;' with docker-compose to pass the environment specific variable file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;U&gt;&lt;STRONG&gt;.env&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/U&gt;DB_USERNAME=alfresco &lt;BR /&gt;DB_PASS=alfresco&lt;BR /&gt;DB_URL=jdbc:postgresql://postgres:5432/alfresco&lt;U&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;.env.dev&lt;/STRONG&gt;&lt;/U&gt;

DB_USERNAME=alfresco_dev
DB_PASS=alfresco_dev
DB_URL=jdbc:postgresql://dev.alfresco.db:5432/alfresco

&lt;U&gt;&lt;STRONG&gt;.env.qa&lt;/STRONG&gt;&lt;/U&gt;

DB_USERNAME=alfresco_qa
DB_PASS=alfresco_qa
DB_URL=jdbc:postgresql://qa.alfresco.db:5432/alfresco&lt;/PRE&gt;
&lt;P&gt;&lt;U&gt;In your standard docker-compose.yml:&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;JAVA_OPTS: "
     -Ddb.username=${DB_USERNAME}
     -Ddb.password=${DB_PASS}
     -Ddb.url=${DB_URL}
   "&lt;/PRE&gt;
&lt;P&gt;When starting the containers you would use following like command:&lt;/P&gt;
&lt;PRE&gt;&lt;U&gt;&lt;STRONG&gt;To Start local containers:&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/U&gt;docker-compose --env-file .env up&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;or (When --env-file param is not passed, docker-compose by default looks for a .env file if available)&lt;/STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/U&gt;docker-compose up&lt;U&gt;&lt;BR /&gt;&lt;/U&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;BR /&gt;To Start Dev containers:&lt;/STRONG&gt;
 
docker-compose --env-file .env.dev up

&lt;U&gt;&lt;STRONG&gt;To Start QA containers:&lt;/STRONG&gt;&lt;/U&gt;
 
docker-compose --env-file .env.qa up&lt;/PRE&gt;
&lt;P&gt;Ofcourse you can manage these environment files as per your org standards.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Checkout this repository as well:&amp;nbsp;&lt;A href="https://github.com/Alfresco/acs-deployment" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/Alfresco/acs-deployment&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 03:01:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126078#M34346</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2021-10-24T03:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: What is the "Correct" way to set values in alfresco-global.properties with docker-comp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126079#M34347</link>
      <description>&lt;P&gt;This does not work using the ./run.sh build_start that comes with the SDK.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 04:38:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126079#M34347</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2021-10-26T04:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: What is the "Correct" way to set values in alfresco-global.properties with docker-comp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126080#M34348</link>
      <description>&lt;P&gt;Ofcourse it won't. You have to update those scripts. These are new commands that won't be there in basic script you get. What you get with sdk is generally for development purposes only.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;You have to update "run.sh" something like:&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;case "$1" in
  build_start_dev)
    down_dev
    build
    start_dev
    tail
    ;;
&lt;BR /&gt;.....&lt;BR /&gt;....
	
down_dev() {
    if [ -f "$COMPOSE_FILE_PATH" ]; then
	docker-compose -f "$COMPOSE_FILE_PATH" --env-file .env.dev down
    fi
}

start_dev() {
    #create volumes
	...
	....
	
	#Start
	docker-compose -f "$COMPOSE_FILE_PATH" --env-file .env.dev up
...
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Oct 2021 13:02:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-is-the-quot-correct-quot-way-to-set-values-in-alfresco/m-p/126080#M34348</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2021-10-26T13:02:17Z</dc:date>
    </item>
  </channel>
</rss>

