What is your setup for "develop on macOS, deploy on FreeBSD?"

Howdy, coming back to FreeBSD after a few years away as I still think it feels like the best Unix system around. I'm creating a web application and I'm experimenting with deploying onto FreeBSD instead of Debian. I prefer the stability and coherence of FreeBSD, even though Debian is sort of the easy solution.

I'm developing on macOS (I've run FreeBSD on a laptop quite a few times, but honestly a Macbook just makes day-to-day life easier) and would like to run my server environment locally for development purposes. If I deploy on Debian the usual answer is "use Docker/Podman/etc."

I know macOS is pretty popular with FreeBSD folks so I'm curious what setup you're using to emulate a FreeBSD server locally? Getting an image running on macOS is stupidly simple with the awesome videos FreeBSD is putting out and that handbook is great, but I'm curious about the end-to-end of giving a developer access to a database, web server, etc. locally that emulates a production deploy and includes your source code. I'm not necessarily looking for a total Docker replacement, just what you're doing for a reproducible local setup.

I'm not a virtualization guru so apologies if this is a silly question. :)
 
I've just bought a mini PC to run FreeBSD so I can test on it directly. Cost £300 but works fine. 32GB of RAM, 16 core CPU and 1TB SSD.
 
Web application: aren't they supposed to be OS agnostic?
HTML interface, backend does something, return HTML?
If so, does it really matter?

Or is the parts behind the HTML the important part?

I guess I don't understand the original question to be able to have valid input.
 
Deploying what things? Database involved? If yes, how does the database hold up in Docker?

I typically ssh directly into the target platform and develop there. Regardless of what my terminal is.
 
I'm not necessarily looking for a total Docker replacement, just what you're doing for a reproducible local setup.
I write notes (like FreeBSD 15.0 Xfce), and do the text editing from a web browser any-OS.

I self-host the wiki (notes) and can do that from any OS with nginx and PHP. I set nginx up bare-metal Windows/Linux/FreeBSD and my configs are mostly the same; it's a LEMP stack with the L changing to W or F I guess :p (I use MariaDB for other sites)

For FreeBSD I did: nginx -> PHP-FPM -> Certbot -> (website). Basically a pkg install freenginx-devel php85 git-lite php85-mbstring and some config; Linux is similar, but Windows I download zips from upstream instead of a package manager (all manual/no convenience like XAMPP or Docker). Same PHP extensions though every OS and similar nginx.conf and PHP settings; I have my wiki up and a secure webserver that can process PHP in about an hour of clean-installing a OS!

MariaDB DBs get flat-dumped to a plain .sql file, and restored as-is easy (no problem cross-OS).
 
Web application: aren't they supposed to be OS agnostic?
HTML interface, backend does something, return HTML?
If so, does it really matter?

Or is the parts behind the HTML the important part?

I guess I don't understand the original question to be able to have valid input.
Yeah the parts behind the HTML, specifically making sure the different programming language runtimes (e.g., Java, Ruby, whatever), servers, databases, etc. work the same during development as during a deploy. If you're running (just as an example) Ruby on your Macbook locally and then the same version of Ruby has a platform-dependent bug/behavior when you deploy to FreeBSD, you wouldn't catch it until a staging/production deploy. It's nice to be able to catch it locally during development and see how things run in a clone of production on your own machine.

Deploying what things? Database involved? If yes, how does the database hold up in Docker?

I typically ssh directly into the target platform and develop there. Regardless of what my terminal is.
Language runtime, web server (nginx) and a database (Postgres). Yeah I've used that workflow before, and a FreeBSD staging server after local development would be a reasonable way to test before deployment.

Only if your FreeBSD ain't satisfactory set up right yet. 😁
Fair enough! I last used FreeBSD on a ThinkPad a few years that I set up from scratch. It ran well enough with some creature comforts not quite up to par, but I've just become lazy with a Macbook. 😁 I'd be willing to test it out again though, not really a huge fan of sending all my data to Big Tech.

Thank you all for the responses, I'm also going to play around with using Vagrant since FreeBSD runs in QEMU really well with basically no modifications on Apple Silicon.
 
A bit ago I started thinking about this and I decided the best would to be to allow my git server to take the point on stuff like this, so I started working on a mini "hub" (or whatever you'd call it). A git hook triggers a little script to build my project and another to package it. For the deployment phase I modified a copy of "Drist" to send and script the parts needed on remote(s). However, I didn't get as far as putting it *all* together but the hook->build->package worked great. A simple makefile for building and identifying parts made it really smooth. I bet someone smarter than I could whip something like this up in no time, but I'd be willing to share my build/package/drist scripts if there would be any interest (they're more-or-less still in a POC phase but it shouldn't be too much work to add some robustness).

A note though: At some point along the way, I found it "more difficult than I thought it would be" in dealing with version numbers on my builds/packages/names, so I switched to pull the git hash and use that as a "version number" (I don't remember why exactly in my case--I *think* it was related to assembly/fetching for a port) this was but I remember having to pause and deal with it). In my makefile I essentially just added:
HASH_VERSION:sh = git rev-parse --short=7 HEAD
HASH_VERSION ?= $(shell git rev-parse --short-7 HEAD)
 
I know macOS is pretty popular with FreeBSD folks so I'm curious what setup you're using to emulate a FreeBSD server locally?
Having done this forever since the promise of MacOS being "unix", don't. MacOS is aggressively hostile to getting anything working.

If you don't like that advice, use homebrew.

I'm not a virtualization guru
Become one. This will make your life easier. On the mac, try UTM. Elsewhere, install Proxmox.
 
Back
Top