09-26-2020 11:20 AM
Hi
my alfresco and share containers running by default in GMT. Which is causing some timestamp specific custom jobs run at wrong timings that required time.
how can i make it running in ET zone?
09-26-2020 08:41 PM
volumes: - /etc/localtime:/etc/localtime
09-30-2020 07:31 AM
So there are two things. One- synchronize the time/timezone etc. with host machine to containers. Two - Set the timezone for containers. In the first case, whatever time/timezone is set on host machine, it will be synchronized to containers.
In second case, you can use different timezone on host machine but can set a specific time zone for containers.
In case of synchronization, we bind mount host machine's localtime file. Which is true for linux but for windows it may not work.
In case of setting time zone, it is independent of host machine, whether it is windows or linux.
Try below settings and see if it works for you on "developer system" and "ubuntu dev server" both as reported by you.
For EDT timezone: environment: TZ: "America/New_York" or
environment: - TZ=America/New_York
A service level example:
alfresco: build: dockerfile: ./Dockerfile context: ./configs-to-override/alfresco mem_limit: 8g environment: JAVA_OPTS: " -Ddb.driver=org.postgresql.Driver -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:postgresql://postgres:5432/alfresco -Dsolr.host=solr6 -Dsolr.port=8983 -Dsolr.secureComms=none -Dsolr.base.url=/solr -Dindex.subsystem.name=solr6 -Dshare.host=127.0.0.1 -Dshare.port=7080 -Dalfresco.host=localhost -Dalfresco.port=7080 -Daos.baseUrlOverwrite=http://localhost:7080/alfresco/aos -Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\" -Ddeployment.method=DOCKER_COMPOSE -DlocalTransform.core-aio.url=http://transform-core-aio:8090/ -Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/ -Djodconverter.url=http://transform-core-aio:8090/ -Dimg.url=http://transform-core-aio:8090/ -Dtika.url=http://transform-core-aio:8090/ -Dtransform.misc.url=http://transform-core-aio:8090/ -Dcsrf.filter.enabled=false -Xms8g -Xmx8g " TZ: "America/New_York" volumes: - ./alfresco/alf_data:/usr/local/tomcat/alf_data
Second e.g.
postgres: image: postgres:11.7 mem_limit: 1g environment: - POSTGRES_PASSWORD=alfresco - POSTGRES_USER=alfresco - POSTGRES_DB=alfresco - TZ=America/New_York command: postgres -c max_connections=300 -c log_min_messages=LOG ports: - 5432:5432 volumes: - ./postgres/data:/var/lib/postgresql/data
09-29-2020 10:52 AM
I am not sure what you mean by not working on developer system, what is your developer system environment?
09-30-2020 06:59 AM
i mean to say developer system is using docker desktop on windows. It is still not working. Shared the compose file above. Working fine on ubuntu dev server.
09-30-2020 07:22 AM
It dose not work on windows because there is no /etc/timezone on Windows
09-30-2020 07:31 AM
So there are two things. One- synchronize the time/timezone etc. with host machine to containers. Two - Set the timezone for containers. In the first case, whatever time/timezone is set on host machine, it will be synchronized to containers.
In second case, you can use different timezone on host machine but can set a specific time zone for containers.
In case of synchronization, we bind mount host machine's localtime file. Which is true for linux but for windows it may not work.
In case of setting time zone, it is independent of host machine, whether it is windows or linux.
Try below settings and see if it works for you on "developer system" and "ubuntu dev server" both as reported by you.
For EDT timezone: environment: TZ: "America/New_York" or
environment: - TZ=America/New_York
A service level example:
alfresco: build: dockerfile: ./Dockerfile context: ./configs-to-override/alfresco mem_limit: 8g environment: JAVA_OPTS: " -Ddb.driver=org.postgresql.Driver -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:postgresql://postgres:5432/alfresco -Dsolr.host=solr6 -Dsolr.port=8983 -Dsolr.secureComms=none -Dsolr.base.url=/solr -Dindex.subsystem.name=solr6 -Dshare.host=127.0.0.1 -Dshare.port=7080 -Dalfresco.host=localhost -Dalfresco.port=7080 -Daos.baseUrlOverwrite=http://localhost:7080/alfresco/aos -Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\" -Ddeployment.method=DOCKER_COMPOSE -DlocalTransform.core-aio.url=http://transform-core-aio:8090/ -Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/ -Djodconverter.url=http://transform-core-aio:8090/ -Dimg.url=http://transform-core-aio:8090/ -Dtika.url=http://transform-core-aio:8090/ -Dtransform.misc.url=http://transform-core-aio:8090/ -Dcsrf.filter.enabled=false -Xms8g -Xmx8g " TZ: "America/New_York" volumes: - ./alfresco/alf_data:/usr/local/tomcat/alf_data
Second e.g.
postgres: image: postgres:11.7 mem_limit: 1g environment: - POSTGRES_PASSWORD=alfresco - POSTGRES_USER=alfresco - POSTGRES_DB=alfresco - TZ=America/New_York command: postgres -c max_connections=300 -c log_min_messages=LOG ports: - 5432:5432 volumes: - ./postgres/data:/var/lib/postgresql/data
10-01-2020 06:45 AM
Worked!! I tried today on developer system docker desktop and ubuntu dev sever both.
@abhinavmishra14 Thnx for great explanation.
Explore our Alfresco products with the links below. Use labels to filter content by product module.