Hi everyone
I am a bit of a newbie to the world of Shopify Remix, but I am really loving the stack. ![]()
I want to use node-cron in my Remix App.
I am using fly.io for my hosting requirements:
fly deploy
The default container script Dockerfile, does not pre-install cron.
But the documentation suggests, using a library called supercronic:
https://fly.io/docs/app-guides/supercronic/
The part I don’t get, is the bit about processes in fly.toml?
[processes]> > # The command below is used to launch a Rails server; be sure to replace with the command you’re using to launch your server.> > web = “bin/rails fly:server”> > cron = “supercronic /app/crontab”> > # Make sure there’s only one
processesentry under[[services]]> > [[services]]> > processes = [“web”]
I feel that we should remove the services section, altogether, and the web part of the processes section. I am pretty sure these don’t apply, if you are running a Node based application, like a Remix App?
My current fly.toml does not have a services or a processes section.
I presume Remix Apps don’t require Rails? They run off NodeJs, which is pre installed from the Dockerfile script:
FROM node:18-alpine> > EXPOSE 3000> > WORKDIR /app> > COPY . .> > RUN npm install> > RUN npm run build> > # You’ll probably want to remove this in production, it’s here to make it easier to test things!> > RUN rm prisma/dev.sqlite> > RUN npx prisma migrate dev --name init> > CMD [“npm”, “run”, “start”]
Can anyone explain the best way to install cron, using the default Remix fly.io container?
Maybe I can just add this to my Dockerfile:
RUN apt-get update> > RUN apt-get install -y cron
Does anyone know where I should add these two commands, in the Dockerfile?