I distinctly remember yum/dnf should be using a loop. Forget why but it's recommended. Here's a snippet from my playbook. Simply make the vars as you need and run.
I have a bash script I use to script my Silverblue install. Something like this should work.
# space-separated list of packages to install
S_RPM_PACKAGES_TO_INSTALL="pkg1 pkg2 pkg3"
# function to install the packages
dnf_install () {
sudo dnf install -y $1
}
# call to function, passing the list
dnf_install "$S_RPM_PACKAGES_TO_INSTALL"
I have it set up this way so that I just have a bunch of bash variables describing the stuff I want to install all at the top of the file, but the function definitions and calls lower down since I don't need to see them.
It also does other things like removes packages from the system, removes some preinstalled flatpaks, installs flatpaks from Fedora Flatpaks / Flathub / gnome-nightly, and sets up gnome through a list gsettings commands.
As I use my system, I add new apps to the list I want next time I install and remove apps I don't use.
I didn't find any script that would install the apps you wanted, but I did find a script that will help you build your own (it's pretty easy). You can take inspiration from this one and modify it, so that whenever you reinstall your system, you'll run your script.
Research what commands are used in Fedora to install what application and add them to your script. Then, give your .sh file execute permissions and run it. You can do this in a virtual machine first if you want.
I did more than 5 installs this weekend (for ... reasons) and the "trick" IMHO is ...
Do NOT install things ahead of actually needing them. (of course this assume things take minutes to install and thus you will have connectivity)
For me it meant Firefox was top of the list, VLC or Steam (thus NVIDIA driver) second, vim as I had to edit crontab, etc.
Quite a few are important to me but NOT urgent, e.g Cura (for 3D printer) and OpenSCAD (for parametric design) or Blender. So I didn't event install them yet.
So IMHO as other suggested docker/docker-compose but only for backend.
Now... if you really want a reproducible desktop install : NixOS. You declare your setup rather than apt install -y and "hope" it will work out. Honestly I was tempted but as install a fresh Debian takes me 1h and I do it maybe once a year, at most, no need for me (yet).
Another "trick" I use is having an ~/Apps directory in which I have AppImage, binaries, etc that I can bring from an old /home to a new one. It's not ideal, bypassing the package manager, and makes quite a few assumption, first architecture, but in practice, it works.
Use appman and set the install directory to ~/Apps and now you will be able to install appimages/binaries in the ~/Apps dir using a package manager that keeps them up to date and that you can move to any other distro, I have all of this:
Although more recently for binaries I've been using this instead, which pulls from a massive repo of static binaries, though note that dbin needs its own separate directory in HOME to install binaries (you can't use ~/Apps that is).
That's one of the things I miss the most in Gentoo, having the packages of your system defined in text files so a fresh install was just copying those files and running an update.
I've tried similar things with other distros, but it's never the same, the list of packages ends up getting out of date or ends up with too much garbage.
Currently I have a home server so I took the time to get an Ansible playbook setup for running, maintaining, and maybe migrating the server if needed. Since some stuff is also run on other machines that I have (update system, update some docker images I run in multiple systems, etc) I did setup some minimal packages that I need on my main system, it's easy enough but I wouldn't recommend using Ansible just for this (but if you also have dotfiles it's a great tool for automating lots of the initial setup).
All of that being said, the reason I never bothered with this until I had a home server is that usually there are years between system installs, so even if what you had was exactly what you wanted the last time you installed your system, it's unlikely to be exactly what you want next time you do. Since the last time I installed my main system I switched from X to Wayland, from i3 to Hyprland and then Sway, etc, etc...
I use an Ansible playbook to do fresh install stuff such as app installs & joining my local Samba AD.
Another option, that I've never tried, would be to put your /home directory on another partition. That only solves the settings though and not your app installation bit.
It should be possible. Although probably very complicated. Have a look at https://distrobox.it/. It allows you to tightly integrate containers into your desktop, including accelerated graphics, some devices, your homedir, etc. It can even automatically install desktop shortcuts. (You can disable the integrations of course)
Even tho it uses Podman instead of docker, AFAIK it should be 1:1 compatible with docker for your usecase.
Have a look at https://distrobox.it/. It allows you to tightly integrate containers into your desktop, including accelerated graphics, some devices, your homedir, etc. It can even automatically install desktop shortcuts. (You can disable the integrations of course)
Furthermore, distrobox allows you to define the list of packages to be installed, see:
Some distros allow this. Nix for example allows you to save config files that describe your entire system (apps, settings, etc) and then load them in one go. Other distros are following suit with their own tailored solutions too (I think Ubuntu might have something? Manjaro?).