While php is still cool... join the dark side and start using containers 😏
Self Hosted - Self-hosting your services.
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules
- No harassment
- crossposts from c/Open Source & c/docker & related may be allowed, depending on context
- Video Promoting is allowed if is within the topic.
- No spamming.
- Stay friendly.
- Follow the lemmy.ml instance rules.
- Tag your post. (Read under)
Important
Beginning of January 1st 2024 this rule WILL be enforced. Posts that are not tagged will be warned and if not fixed within 24h then removed!
- Lemmy doesn't have tags yet, so mark it with [Question], [Help], [Project], [Other], [Promoting] or other you may think is appropriate.
Cross-posting
- !everything_git@lemmy.ml is allowed!
- !docker@lemmy.ml is allowed!
- !portainer@lemmy.ml is allowed!
- !fediverse@lemmy.ml is allowed if topic has to do with selfhosting.
- !selfhosted@lemmy.ml is allowed!
If you see a rule-breaker please DM the mods!
Yeah, I can't imagine going back to not using containers. Call me a script kiddy if you want but I can copy paste some environment variables into a Docker Compose and stand up a new service in ten minutes.
I'm not going to say it's always smooth sailing. I've definitely had containers with frustrating complications that took some sorting out. But man, if you want to just drop some files in a directory and go? Just get on board the Docker train and save yourself the headache.
Containers really shine in the selfhosting world in modern times. Complete userspace isolation, basically no worries about dependencies or conflicts since it's all internally shipped and pre-configured, easy port mapping, immutable "system" files and volume mounting for persistent data... And much more. If built properly, container images solve almost all problems you're grappling with.
I can't imagine ever building another application myself without containerization ever again. I can't remember the last time I installed any kind of server-side software directly on a host without containerization, with the exception of packages required by the host that are unavoidable to support containers or to increase security posture.
I'm my (admittedly strong) opinion, it's absolute madness, and dare I say, reckless and incomprehensible, why anybody would ever create a brand new product that doesn't ship via container images in this day and age, if you have the required knowledge to make it happen, or the capacity to get up to speed to learn how to make it happen (properly and following best practices of course) in time to meet a deadline.
I'm sure some would disagree or have special use-cases they could cite where containers wouldn't be a good fit for a product or solution, but I'm pretty confident that those would be really niche cases that would apply to barely anyone.
And that's why my rule is: if it doesn't container it doesn't go on my server. If I can't get the application crammed into my docker compose stack I look for an alternative. Hell I run PiHole and Octoprint inside container
The thing that boils my blood is secret sqlite databases. I just want to store my volumes on an NAS using NFS, and run the stacks on a server built for it. Having a container randomly blows up because an undocumented sqlite database failed to get a lock sucks ass.
secret sqlite databases
The thing is: "secret". SQLite databases in general are awesome. Basically no need to configuration. They just work and don't even need an own server and in 99% of all cases they're absolutely enough for what they used for. I'd always chose a SQLite database over anything else - but it should made clear that such a database is used.
Docker containers do pretty much solve that, drop a docker-compose.yml
file in place, maybe tweak a few lines, and that's all.
retvrn to cgi-bin
Sometimes venting off a little helps a a little. I finally sat down and learned the basics of docker and found an easy to follow video series on how to setup Docker with Portainer and Nginx Proxy Manager. Works like charm. I also set up my GoToSocial instance again but failed at setting up a Lemmy instance … but I guess that’s for another discussion :)
Care to share what the helpful series was?
Sure. It’s a 4-part video series by German YouTuber Raspberry Pi Cloud created end of 2021 (but still works with most recent versions).
He goes from technical background over basic system preparation and Docker installation to a fully featured setup. I skipped lots of content up to the point where he was done with the Docker installation (I prepared and “cleaned” my system and installed Docker beforehand.)
- Basics and somewhat not-so-nice manual Docker installation not using the system’s package manager: https://www.youtube.com/watch?v=8QgBqu-tE-I
- Portainer installation and setup and general usage: https://www.youtube.com/watch?v=ZYgCYgxbKgQ
- Nginx Proxy Manager and reverse-proxying, Vaultwarden installation: https://www.youtube.com/watch?v=SsnrH-5_ORE
- More on Nginx Proxy Manager (Let’s Encrypt), Pi-Hole installation and setup: https://www.youtube.com/watch?v=D6aOdey5nj8
Not sure what's the problem though. Pull up a reverse proxy, and give all the crappy shit a private ip and whatever port they want, and access it through the proxy, and everyone can be on 443. 127.42.1.123:443,
whatever.
Maybe use real containers, or that crappy docker shit, both offer you independent namespaces with all the port and whatnot.