-
-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Hello Boltheads and Docker Friends,
i was using Bolt via composer setup in the past but in the last couple of years changed to completely dockerized servers. There are a couple of things about the current Docker setup for bolt that i feel could be optimized or should be changed.
I know that there are lot of use cases for docker setups, and unlike mentioned in the Bolt documentation, running a production site via Docker is not only possible but could be a very quick and handy way to setup Bolt-powered websites. Discussions about Docker can quickly become dogmatic, since there are many people that have pretty strong objections against it - while most of them never actually tried using docker containers, maybe those people could refrain from participating in the discussion.
i think its good if we could assume that docker containers CAN run production websites, because this is done a lot. even by very big companies. VPS servers and other cloud computing platforms that run Docker containers are becoming cheaper every year, so the classical "managed host with php" scenario may become less and less in thu future.
The last days i spend understanding the existing Bolt Docker setup, going through the Dockerfiles etc. My biggest ciriticism would be the lack of documentation and the complexity in which things are organized. Then and there are some things that i don't understand or don't think are very efficient:
-
The Container configures a NGinx to serve the static files and proxy PHP-FPM. But then the docker-compose.yml stack sets up ANOTHER NGinx proxy server in front of the other NGinx, just for SSL and http2. Maybe there is something i dont understand about this approach. i think it would be fairly easy to optionally setup the self signed cert and http2 for the existing Nginx, enabling & disabling options via the .env file. Personally i dont need either, since i have a central ssl offloading proxy server (HAProxy) for all my internet facing containers and i think this is what most people have. Would it no be enough to set up an unencrypted Nginx and make a note in the docs that people should look into a Proxy Servers and LetsEncrypt et al if they want to run this properly?
-
Minor thing, but why name the Bolt container "php", i guess it should be either "nginx-php-bolt" or similar or just bolt.
-
While i see the advantage of only having to clone the entire bolt/project directory from github, regardless of running the composer setup or via docker, there is a lot of "garbage" left over from this approach, which is simply not needed or used when running the docker.... i think it would be fair to argue for a seperate bolt/docker repo, which clones the required bolt/project files into the container during the built progress and not throws everyting together, duplicates it and leaves a big mess at the end.
-
i think a reasonably big share of bolt users might be OK with a SQLite based install for small project websites. or a quick tryout. the ones that need MariaDB / MySQL probably have a Database already running or know how to set one up. In any case it should be very easy and well documented how to switch between these two types of setup. This is not the case at the moment.
-
I guess the idea behind running a complete build process for everyone that wants to run the Bolt Docker is to optimize cross platform compatibility? I think this might be problematic for people running low spec servers (think RPi <=4)... There are other approaches, like automatic cross platfotm container builds using CI etc.. This is probably a lot of work to set up initially but then save EVERY user to go through the build process again.
-
Generally speaking, a more streamlined, simple and well documented approach Docker pre-built Container would encourage more people to give Bolt a try by just spinning it up quickly. With the level of complexity, the extra build steps and lack of documentation there is a risk that people just feel overwhelmed and give it a pass.
-
The default 2021 theme is built around tailwind.css which CAN be used as a complete CDN version, in which case its a hefty 3.3MB css file. But it really only makes sense if you run a build chain with postcss and compile it for YOUR use case. If Bolt stays with tailwind, the build chain (node.js / npm / postcss / autoprefixer / maybe nanocss) should be integrated in the Docker container as well, to make it usable as a complete starting point for building your sites. Either the build chain could be integrated into the nginx-php-bolt container or the docker-compose stack could bring in another container in the stack which takes care of that, similar to - https://hub.docker.com/r/hut6/postcss
Like i said, totally possible that i misunderstood a couple of the original ideas, in which case i would be happy if someone would enlighten me about what was intended.
Cheers,
T.