OK, I have been looking at this so that I can move my web development from Windows to Linux.
I am not using Silverblue (yet!) but I want to figure out a workflow that will also work on SilverBlue and is something that I can develop further when needed.
I want something that:
- Does not require any modification of the overlay (local install )
- Can allow easy modification
- Local development domain resolution
My current thinking:
Use Podman for a container for php/httpd and another one for Mariadb. this prevents the requirement for adding packages to the overlay.
Following https://developers.redhat.com/blog/2018/11/29/managing-containerized-system-services-with-podman/ I can get a single site running, but I have gotten stuck in a few places.
For a proper web development workflow it needs to be extended/modified to work with the following data structure:
The first one is obvious and the same as in that blog. The second one is similar - but when using composer in projects generally the new files will be in a subdirectory (web in this case).
The third folder is to allow custom vhosts declarations. The one I have now is pretty simple and contains the following:
CustomLog /var/www/requests.log combined
This works on a locally installed httpd server (it allows for multiple sited suffixed by “.localhost” to work), but not for the container, because I probably have an incorrect entry point.
The service files suggested in the blog keep the webserver container active. For development ideally they would be woken up once accessed and once the command is run, shut down. This will then also allow updating of the vhosts files to have an instantaneous impact.
Finally a snippet would be required for the host system to be resolved by systemd-resolved to redirect domains other than .localhost to be redirected to localhost. This seems to be possible by adding a configuration file at
/etc/systemd/resolved.conf.d/*.conf but I haven’t figured out what it should contain. With this and the vhosts configuration it should be possible to have a semi automated web development environment.
Any pointers to setting this up/providing a step by step guide would be appreciated (and I think it would also make a great guide for the website).