Absolutely, but it has a built-in webserver that can serve static files, too (I constantly use that in my dev environment).
How about Python? You can get an HTTP server going with just python3 -m http.server
from the dir where the files are. Worth remembering because Python is super common and probably already installed in many places (be it on host or in containers).
CameronDev@programming.dev 8 months ago
Having PHP installed is just unnecessary attack surface.
Are you really struggling for space that 50mb matters? An 8gb usb can hold thar 160x?
Dirk@lemmy.ml 8 months ago
Yes! Especially running it’s built-in webserver outside your dev environment. They “advertise” doing so in their Docker packages documentation, though. Every project without PHP is a good project. It’s still an option - at least technically.
In a way, yes. I just want to optimize my stuff as much as possible. No unneeded tools, no overhead, a super clean environment, etc. Firing up another Nginx container just doesn’t feel right anymore. (Even if it seems to be possible to manually “hack” file serving into NPM - which makes it a multi-use container serving various different sites and proxying requests.)
The machine I use as docker host also has a pretty low-end CPU and measly 4 gigabytes of RAM. So every resource not wasted is a good resource.
CameronDev@programming.dev 8 months ago
RAM is not the same as storage, that 50mb docker image isn’t going to require 50mb of ram to run. But don’t let me hold you back from your crusade :D
Dirk@lemmy.ml 8 months ago
Thanks for educating me on basic computer knowledge! 🤣
Applications need RAM, though. A full-fledged webserver with all the bells and whistles likely needs more ram than a specialized single-binary static file delivery server.