Not sure if this is a bug report or a request for help.
List of steps to reproduce:
Folder structure:
docker-compose.yml
wiki/
generated/ (empty)
data/ (empty)
Dockerfile./docker-compose.yml contains:
version: "3.8"
services:
wiki:
build: wiki/.
ports:
- "80:80"
restart: on-failure
volumes:
- type: bind
source: ./wiki/data
target: /var/www/datawiki/Dockerfile contains:
FROM mediawiki:latest RUN apt update RUN apt install sqlite3 COPY ./generated/ /var/www/html
(The last command copies ./generated/LocalSettings.php into the image, once it's there)
What happens?
Navigate to http://localhost:80/ and I am prompted to "complete the installation", so I do so, with the following settings:
- Next Page: Languages: english / english
- Next Page: Environmental checks pass.
- Next Page: database: SQLite, SQLite data directory: /var/www/data, Database name: my_wiki
- Next Page: Name of my Wiki: My Wiki, username, password, email, etc..., Ask More Questions...
- Next Page: Open Wiki, No license footer, Disable Outbound Email, leave three skins, add three editors, Continue...
- Next Page: 'Continue' to start installation
Installation Fails:
* Including extensions... done * Setting up database... **Warning**: file_put_contents(/var/www/data/.htaccess): failed to open stream: Permission denied in **/var/www/html/includes/installer/SqliteInstaller.php** on **line 184** **Warning**: file_put_contents(/var/www/data/my_wiki.sqlite): failed to open stream: Permission denied in **/var/www/html/includes/installer/SqliteInstaller.php** on **line 327** **Warning**: file_put_contents(/var/www/data/wikicache.sqlite): failed to open stream: Permission denied in **/var/www/html/includes/installer/SqliteInstaller.php** on **line 327** **Warning**: file_put_contents(/var/www/data/my_wiki_l10n_cache.sqlite): failed to open stream: Permission denied in **/var/www/html/includes/installer/SqliteInstaller.php** on **line 327** **Warning**: file_put_contents(/var/www/data/my_wiki_jobqueue.sqlite): failed to open stream: Permission denied in **/var/www/html/includes/installer/SqliteInstaller.php** on **line 327**
Then in red:
**failed** Could not create database file ``/var/www/data/my_wiki.sqlite``. Could not create database file ``/var/www/data/wikicache.sqlite``. Could not create database file ``/var/www/data/my_wiki_l10n_cache.sqlite``. Could not create database file ``/var/www/data/my_wiki_jobqueue.sqlite``.
What I've Tried:
Check accessibility of /var/www/data:
I've checked that the bind mount is working correctly:
docker exec wiki_container -it /bin/bash
cd /var/www/data
And then cat something >test.txt places test.txt on the host drive, so the folder is mounted and writeable.
SQLite Test:
I had a SQLite database for a MediaWiki created in a different environment, so I copied it into the wiki/data folder to be bound into the container, and copied the LocalSettings.php file into wiki/generated, rebuilt, and ran the compose file. When running sqlite3 from the running container's command line, I was able to connect to the database at /var/www/data/my_wiki.sqlite and list tables, etc., but MediaWiki was not able to find it, and reported 'Site unavailable... (Cannot access database)
Where do I go?
So, the data folder is attached and writeable, SQLite is installed and working with it; I'm not sure where else to look...