Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set the timezone cron/ofelia will run in #54

Open
asgeo1 opened this issue Dec 6, 2022 · 4 comments
Open

Ability to set the timezone cron/ofelia will run in #54

asgeo1 opened this issue Dec 6, 2022 · 4 comments

Comments

@asgeo1
Copy link

asgeo1 commented Dec 6, 2022

I can't see any way to set the timezone that the cron/ofelia container is using.

For other containers, i.e. php, I can set this in docker-compose-custom.yml, i.e.

version: '3.5'

services:

  php:
    environment:
      - TZ=Australia/Melbourne
    volumes:
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"

There should be some way to do this for the cron/ofelia container, since this Ofelia ticket suggests that it does respect TZ environment variable if set.

My server is in Australia/Melbourne, as are most of the containers - except for ee-cron-scheduler which appears to still be in UTC+0, which is lame as I'd like everything to be using the same timezone.

Hope there is a way!

@webysther
Copy link

webysther commented Jul 3, 2023

This works for me:

version: "3.9"

services:
  ofelia:
    image: mcuadros/ofelia:latest
    container_name: app-cron
    command: daemon --docker
    network_mode: none
    environment:
      TZ: Europe/Rome
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

@webysther
Copy link

@trane9991 this can be closed.

@asgeo1
Copy link
Author

asgeo1 commented Jul 21, 2023

Thanks @webysther, but I don't understand, where are you putting that docker configuration?

It looks like you're running your own Ofelia container outside of Easy Engine.

The question is how do I do that within the context of Easy Engine, given it is a wrapper around Docker, and has it's own ee cron commands, and it's own custom version of the Ofelia docker image that it runs.

The documentation here suggests you can create a custom /opt/easyengine/services/docker-compose-custom.yml for customising global services.

I've tried creating that file and populating with this configuration

version: '3.5'

services:
  global-cron:
    environment:
      - TZ=Melbourne/Australia

And then refreshing the containers with ee service refresh

But when I connect to the running cron container with docker exec -it cbdc0838924f /bin/sh and run date, it still has the date in UTC, so not sure that it's working.

@webysther
Copy link

Sorry, wrong repository! Ignore my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants