DEV Community

Cover image for You Don't Need Docker, Redis or a Queue to Run a Real Product
Elliot Brenya sarfo
Elliot Brenya sarfo

Posted on

You Don't Need Docker, Redis or a Queue to Run a Real Product

Uses free Cloudflare Workers for cron jobs

My product runs on shared hosting. No Docker, no Redis, no queue workers, no Kubernetes, no build step.

It has 40 scheduled jobs, a VIN checker, a price checker across several shops, server-rendered share images, and 534 commits since January. It works.

It ain't much, but it's honest work

I'm not saying this setup is right for everyone. I'm saying most of us reach for infrastructure long before we need it.

What it actually runs on

TrustCheck is Laravel 12, PHP 8.3 and MySQL, with server-rendered Blade and plain CSS and JavaScript. There's no npm run build. The CSS file you edit is the CSS file the browser gets.

The parts people usually add infrastructure for, and what I did instead:

Scheduled jobs. My host doesn't give me a crontab over SSH. So a free Cloudflare Worker calls one URL every minute:

export default {
    async scheduled(event, env, ctx) {
        const res = await fetch(env.TICK_URL, {
            method: 'POST',
            headers: { 'X-Cron-Token': env.CRON_TOKEN },
        });
        if (!res.ok) throw new Error('Tick failed: HTTP ' + res.status);
    },
};
Enter fullscreen mode Exit fullscreen mode

That URL starts php artisan schedule:run as a detached process, so a long job never holds the web request open. All 40 jobs run from it.

Caching. Laravel's file cache. VIN reports, price results, shop catalogues. No Redis server to run or pay for.

Slow work. Instead of a queue, slow things happen on a schedule. The price checker downloads shop catalogues every 4 hours, so a visitor's search only reads a cached copy. The car checker warms its popular pages at night.

Deploys. git pull on the server, rebuild Laravel's caches, check the live site. The vendor/ folder is committed, because shared hosting can't run Composer reliably.

What it costs me

It isn't free of pain. Shared hosting has limits you only find by hitting them. exec() is disabled, so I use proc_open(). There's a cap on threads per account that killed an image renderer. There's a virtual memory ceiling that killed a job using 60 threads.

Every one of those took me an afternoon to find. But that's a few afternoons, not a monthly bill and a second job running servers.

The argument against

The fair objection: this doesn't scale. If TrustCheck had a million users, a file cache and a cron Worker wouldn't hold.

I agree. When that happens, I'll move. The move will be easier because the app is simple, and I'll know exactly which part broke first, instead of guessing in advance.

Until then, every hour I'd spend on Docker files is an hour not spent on the product.

What's the simplest setup you've run a real product on? And what finally made you move off it?

Top comments (9)

Collapse
 
rushdeploy profile image
Rishabh Mishra •

This is a good reminder that boring infrastructure is often the right call for a small product. The Cloudflare Worker as a cron replacement is clever, and keeping the app simple makes the eventual move much easier. Thanks for sharing the real trade-offs, not just the wins.

Collapse
 
elliot_brenya profile image
Elliot Brenya sarfo •

Thanks Rishabh. The trade-offs were the part I wanted to be honest about. The setup only looks clean once you've already paid for the afternoons it took to find the host's limits.

Collapse
 
rushdeploy profile image
Rishabh Mishra •

That honesty is what makes the post useful. Knowing the memory ceiling and thread cap before launch would save most people those afternoons, even if the fix itself stays simple.

Collapse
 
userxnom profile image
Abdullah Naseer •

The Cloudflare Worker calling schedule:run every minute is the cleverest part — you rebuilt cron on shared hosting for free instead of paying for a queue service you did not need. And committing vendor/ because shared hosting cannot run Composer reliably is the kind of honest trade-off most "simple setup" posts leave out. The line that stuck with me is that the move will be easier because the app is simple and you will know exactly which part broke first. What would be the first thing to break for TrustCheck — the file cache under load, or the one-minute tick when jobs start overlapping?

Collapse
 
elliot_brenya profile image
Elliot Brenya sarfo •

Honestly I think the jobs go first, not the cache. Reading a cached file is cheap. What has already hurt me is heavy scheduled work running into the host's memory and thread limits, and that was with barely any traffic. So if I had to bet, it's a job outgrowing the box before visitors ever do.

Collapse
 
wbcomdesigns profile image
Wbcom Designs 💡 •

40 scheduled jobs on shared hosting would make a lot of people nervous and it clearly just works.

Collapse
 
elliot_brenya profile image
Elliot Brenya sarfo •

It made me nervous too at first, ha. The thing that calmed me down was running schedule:run as a detached process, so the web request that triggers it returns straight away and a long job can't hang it. After that it's mostly just been quiet.

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

finding the limits by hitting them cost a few afternoons. a monthly bill and a second job running servers would have cost more.

Collapse
 
elliot_brenya profile image
Elliot Brenya sarfo •

Yeah, that's the maths I keep coming back to. And the afternoons are a one-off. Once I know the memory ceiling is there, I just don't build past it.