is anyone here running background processes on a s...
# lucee
e
is anyone here running background processes on a schedule in a lucee container? we're using the lucee image from here: https://github.com/Ortus-Solutions/docker-commandbox cron isn't available in the image, and we're trying to run a process in the background on a regular schedule that checks if email is having any issues in the container (if email isn't working in the container we can't get email alerts when something is broken, so we send a text message in that scenario separate from the CF server that's running). only problem is cron isn't present so i'm wondering how everyone else is running non-CF jobs on a regular schedule in the lucee image
z
RUN apt-get -y install cron
?
e
i tried going that route along with
service cron start
but it still didn't run any jobs after dumping scripts in
/etc/cron.d
the cron definition for the scripts, that is
b
@Eric I don't recommend using mail spooling in Docker. A docker container, by design, can spin down and go away forever at any time and you'll lose all unsent mail
Either • disable spooling (yes,. this will make sending an E-mail take a bit longer) • or use an external service like Postmark (recommended!)
Switching to a library like cbMailServices will make bullet #2 easy, seamless, and configurable per environment.
e
it turned out that environment variables i was expecting didn't exist when cron ran. once i added them then the script ran fine. only problem now is figuring out how to run
service cron start
when the container first starts up
a
We've use a volume for the spool dir, so the queued mail survives if the container doesn't.
We also use sendgrid upstream, and for reasons that complete stump me, we use cfmail to talk to it, not their API.