Giter Club home page Giter Club logo

Comments (4)

petehalverson avatar petehalverson commented on July 17, 2024

Thanks for the input. The cron examples need some attention.

Which method do you prefer using to trigger your cron process?

from docker-octobercms.

tobias-kuendig avatar tobias-kuendig commented on July 17, 2024

I'm currently using the ENABLE_CRON method, but mostly because of a current hosting setup that we don't control ourselfes, so it's easier to have everything in one container.

I do think the separate cron container is the nicer solution and I would prefer it for other projects.

from docker-octobercms.

jacksun101 avatar jacksun101 commented on July 17, 2024

By default, cron does not care about the environment variables that are set in the Dockerfile. This means that all scheduled cronjobs will run with a completely different configuration ‒ in my case they run against the wrong database.

A workaround for this is to print all env variables to /etc/environment where crontab will pick them up.

Adding this line to the entrypoint script will fix this problem:

printenv  >> /etc/environment

Thanks, tobias. But where exactly did you add the line in the entrypoint script?

from docker-octobercms.

tobias-kuendig avatar tobias-kuendig commented on July 17, 2024

I did add this right before the exec line:

# Put env variables to /etc/environtment
printenv | grep -v "no_proxy" >> /etc/environment

exec "$@"

I don't remember why the exclusion of the no_proxy variable was necessary in our case (it's been a while 🙈)

from docker-octobercms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.