0

It's possible to run a wikibase/mediawiki instance locally using docker-compose: https://www.mediawiki.org/wiki/Wikibase/Docker.
This works on my macbook without trouble, but now I'm trying to get it running on Azure as a Container Instance (ACI).
I don't want the MariaDB as a container, so I've created an AzureDB for that. Other than that I've modified the docker-compose file as follows, according to https://docs.docker.com/cloud/aci-integration/:

version: '3.8'

x-common-variables: &wikibase_variables
  DB_SERVER: ${DB_SERVER}
  MW_ADMIN_NAME: ${MW_ADMIN_NAME}
  MW_ADMIN_PASS: ${MW_ADMIN_PASS}
  MW_ADMIN_EMAIL: ${MW_ADMIN_EMAIL}
  MW_WG_SECRET_KEY: ${MW_WG_SECRET_KEY}
  DB_USER: ${DB_USER}
  DB_PASS: ${DB_PASS}
  DB_NAME: ${DB_NAME}
  WIKIBASE_HOST: ${WIKIBASE_HOST}

services:
  wikibase:
    image: "${WIKIBASE_BUNDLE_IMAGE_NAME}"
    container_name: "wikibase"
    restart: unless-stopped
    ports:
      - "80:80"
    volumes:
      ## This shares the configuration with jobrunner
      - mydata:/var/www/html:rw

      ## Uncomment this next line to mount your own LocalSettings.php file
      #- ./LocalSettings.php:/var/www/html/LocalSettings.d/LocalSettings.override.php

    networks:
      default:
        aliases:
          - ${WIKIBASE_HOST}
          - wikibase-docker.svc
    environment:
      <<: *wikibase_variables
      WIKIBASE_PINGBACK:
      MW_WG_ENABLE_UPLOADS:

volumes:
  mydata:
    driver: azure_file
    driver_opts:
      share_name: my-docker-volumes-fs
      storage_account_name: myvolumesa

All environment variables are defined in a .env file. Where DB_SERVER=my-mariadb-server.mariadb.database.azure.com:3306.

Now if I try to run docker compose up (docker-compose is not supported in the aci context) using the aci context, it fails without any logging (not in the terminal, nor in the Azure portal).

When trying to run just the wikibase container with:

docker run --env-file .env -v myvolumesa/my-docker-volumes-fs:/var/www/html:rw -p 80:80 wikibase/wikibase-bundle:1.36.3-wmde.5

I get this output:

[+] Running 2/2
 ⠿ Group distracted-villani  Created                                                                                                                                                                               4.5s
 ⠿ distracted-villani        Created                                                                                                                                                                             353.3s
wait-for-it.sh: waiting 300 seconds for kbga-mariadb-server.mariadb.database.azure.com:3306
wait-for-it.sh: kbga-mariadb-server.mariadb.database.azure.com:3306 is available after 0 seconds
wait-for-it.sh: waiting 300 seconds for kbga-mariadb-server.mariadb.database.azure.com:3306
wait-for-it.sh: kbga-mariadb-server.mariadb.database.azure.com:3306 is available after 0 seconds
Could not open input file: /var/www/html/maintenance/install.php
2022-08-03T11:21:15.3026758Z stderr F 

I suspect a problem with volume permissions, but I'm not sure how to fix it. Has anyone successfully spun up a wikibase-docker on Azure, or does anyone know how to get this working? Thanks!

Lao
  • 55
  • 1
  • 7

1 Answers1

0

I figured out how to fix this error: Turns out I didn't need to specify the volume mapping to /var/www/html. When I removed this and the volume specification, it successfully installed. I'm still kind of confused why locally it needs a volume but not on ACI, but I'm happy it's running.

The working docker-compose.yml:

version: '3.8'

x-common-variables: &wikibase_variables
  DB_SERVER: ${DB_SERVER}
  MW_ADMIN_NAME: ${MW_ADMIN_NAME}
  MW_ADMIN_PASS: ${MW_ADMIN_PASS}
  MW_ADMIN_EMAIL: ${MW_ADMIN_EMAIL}
  MW_WG_SECRET_KEY: ${MW_WG_SECRET_KEY}
  DB_USER: ${DB_USER}
  DB_PASS: ${DB_PASS}
  DB_NAME: ${DB_NAME}
  WIKIBASE_HOST: ${WIKIBASE_HOST}

services:
  wikibase:
    image: "${WIKIBASE_BUNDLE_IMAGE_NAME}"
    container_name: "wikibase"
    restart: unless-stopped
    ports:
      - "80:80"
    networks:
      default:
        aliases:
          - ${WIKIBASE_HOST}
          - wikibase-docker.svc
    environment:
      <<: *wikibase_variables
      WIKIBASE_PINGBACK:
      MW_WG_ENABLE_UPLOADS:
volumes:
  mydata:
    driver: azure_file
    driver_opts:
      share_name: my-docker-volumes-fs
      storage_account_name: myvolumesa
Lao
  • 55
  • 1
  • 7