Rossonius Pun
Volume storage not available while building from Docker image?
Alright, fewf. It does seem to at least be running and using your FileBrowser template additionally allowed copying the LocalSettings file over to the volume. It’s clumsy, but it may work.
Many thanks for your help!!
44 replies
Volume storage not available while building from Docker image?
I'm interested in MediaWiki despite its design flaws (as well as learning a bit about Docker and Railway along the way) which means I need to be able to access
/var/www/html
on my volume. A mounted volume in Railway can only be accessed by the app after the container is running. With the default MediaWiki DockerHub image, I note that the actual MediaWiki "install" portion basically amounts to downloading a tarball using curl and extracting it into /var/www/html
, something that doesn't work if that's where the volume is mounted.
My work-around is to use a custom Dockerfile hosted on a private repo that is a copy of the MediaWiki file with a few key lines added. The end result is that the MW files end up untarred into a temp directory, and an executable shell script is used as the main CMD
entrypoint instead of running apache. This shell script first copies all of the MW files from the temp directory into /var/www/html
(which will now be the mounted volume, at "runtime" for the container), deletes the temp directory, then runs the apache server as per usual.44 replies
Volume storage not available while building from Docker image?
Yeah I hear you. I'm more thinking of my own learning though because I'm seeing now I had a misapprehension about what was happening with volumes. The MediaWiki design is fair to criticize, but I presume it's likely because it came about in an era before distributed deploys like docker/railway/etc.
44 replies
Volume storage not available while building from Docker image?
I'm interacting with dockerfiles and expecting the volume stuff to be the same as with Docker, but Railway is actually doing other work like converting to nixpacks (iirc) and handling volumes mounted to services in an unrelated way.
44 replies
Volume storage not available while building from Docker image?
At least comparing (naively) Railway to running a Docker image on my own PC, this is due to a fundamental difference in how volumes are handled by Docker by default vs how Railway is implementing volumes.
44 replies
Volume storage not available while building from Docker image?
I've looked at this some more and while I can't say for certain the fault lies with Railway, I'm at a loss for what else could be the issue.
Based on the mediawiki Dockerfile source used to generate their image
https://github.com/wikimedia/mediawiki-docker/blob/fdf347f62615dad789d0e703fc2f6d628c43d4e1/1.40/apache/Dockerfile
I've broken things down to the simplest case that results in the service not running as expected:
Using that custom Dockerfile in a new service, I am able to successfully run this on Railway and accessing the generated domain gives me the expected 'Hello world' page.
However, mounting a volume to
/var/www/html
on that same service then trying to run with no other changes, I receive a 403-Forbidden error along with this entry in my my Deploy logs on Railway:
AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
44 replies
Volume storage not available while building from Docker image?
This only happens on Railway though. As I mentioned, using the same image from dockerhub and running on my own PC
docker run...
with the same mount point gives me a working container that behaves as expected: all of the usual stuff that MediaWiki puts in /var/www/html
is present and accounted for, except it's all sitting on the mounted volume. At that point I can add the LocalSettings file and know it will persist. I don't know why this isn't possible on Railway.44 replies
Volume storage not available while building from Docker image?
And since both the images directory and the LocalSettings.php file itself are contained within
/var/www/html
I would have thought it sufficient for deploying on Railway (if not exactly the intention for the dockerhub image) that I optionally include a single volume mounted at /var/www/html
, encapsulating both the images dir and LocalSettings file.44 replies