Giter Site home page Giter Site logo

cron missing in image about docker HOT 3 CLOSED

jclsn avatar jclsn commented on May 28, 2024
cron missing in image

from docker.

Comments (3)

tzerber avatar tzerber commented on May 28, 2024 1

There's no need to build a custom image. There are numerous ways of addressing this, but the simplest approach is a cron job on the host.

E.g. nextcloud/previewgenerator#176 (comment)

To extend this reply:
Most docker instances nowadays have a separated "cron" container that offloads the cron jobs since some of those are quite intensive and can block the PHP proccess for long time.

That container is basically the same NC instance that uses the cron.sh docker entrypoint.
Instead of using the applications's container, a more "portable" solution is to use the cron container and/or it's crontab.

To do so : instead of using the main container name, use the cron container name to execute the same task, for example (copied from link above) 0 22 * * * root cd /docker/nextcloud/ && /usr/local/bin/docker-compose exec -T --user www-data cron php occ preview:pre-generate.

Other options include mounting the file /var/spool/cron/crontabs/www-data as volume, and putting the desired crontab entries there. With recent including of the watch parameters of Docker, you don't need to do anything additional.

And i should probably make an example of this feature, because it's quite a powerful feature that is not used around here, and it should be.

from docker.

jclsn avatar jclsn commented on May 28, 2024 1

Okay, thank you for clearing that up :)

from docker.

joshtrichards avatar joshtrichards commented on May 28, 2024

There's no need to build a custom image. There are numerous ways of addressing this, but the simplest approach is a cron job on the host.

E.g. nextcloud/previewgenerator#176 (comment)

from docker.

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.