Docker/kubernetes is fine for things that make money, but for small personal projects it is far too much complexity and I dumped it. pm2 gets the job done with less effort overall.
Why did you prefer pm2?
If you’re sat in an office, you’re on a work computer, you need reproducible dev environments, probably none of that bothers you.
However, if I’m working by myself, I don’t want to deal with any of that Rube Goldberg shit. I use shell scripts, ssh, rsync and pretend it’s the 00s again, and oh my god I’m so much happier in that universe.
It saved me from the Rube Goldberg esque pile of bash scripts and puppeteer configs of the 00s.
Funny how perception changes.
The other problem for me is, let’s say you’re in a hotel with crappy wifi and docker wants to download a large quantity of images, you’re in for a rough time.
There’s a very sharp downwards trajectory of user experience once you leave the happy path.
A well crafted image may add an extra 500MBs on top of that. By no means minimal, but not really that bad. (Assuming you have no base images like python or Ubuntu already on your system)
And idk what you mean by “happy path” for docker. Every dockerfile is a snowflake. It’s not a framework like rails.
If you have a good understanding of the tool you shouldn’t have any trouble.
I'm using runit instead of pm2. Systemd should also do fine. It's over engineered.
https://learn.microsoft.com/en-us/windows/wsl/compare-versio...
It’s been a long time.
I get to rsync my code up to a server, & pm2 restart it. The server process runs like any other, no container issues to consider, just a json file saying how I'd run it myself if I wanted to
tbf I'd rather replace pm2 with systemd, since I'm using it to run a Rust program, but if I was using node their cluster mode looks neat
You may already have your own in-app log rotation before adding PM2 so may want to avoid printing to stdout/stderr. For usage with docker you want pm2-runtime.
For small projects, there is now a way to run docker containers or pods (through podman) via systemd units, so if you are using a systemd enabled distro, then that may be a better alternative than pm2, especially if you already have proficiency in docker and kubernetes.