0

I'm attempting to install MediaWiki using the Docker image mediawiki:1.40.0-fpm. It's my intention to use an external instance of Nginx as reverse proxy for SSL termination.

I can start the container successfully, but when I try to connect as per the documentation using; curl http://127.0.0.1:8081 I get; curl: (56) Recv failure: Connection reset by peer

My docker-compose.yml looks like this;

services:
  mediawiki:
    container_name: mediawiki
    image: mediawiki:1.40.0-fpm
    restart: always
    ports:
      - "127.0.0.1:8081:80"
    volumes:
      - ./images:/var/www/html/images
      # After initial setup, download LocalSettings.php to the same directory as
      # this yaml and uncomment the following line and use compose to restart
      # the mediawiki service
      # - ./LocalSettings.php:/var/www/html/LocalSettings.php

    environment:
      MEDIAWIKI_SITE_SERVER: https://wiki.my.domain
      MEDIAWIKI_SITE_NAME: My Wiki

      # you need to specify the reference to the database, Docker no longer
      # shares environmental variables between linked containers
      MEDIAWIKI_DB_TYPE: mysql # 'mysql' or 'postgres'
      MEDIAWIKI_DB_HOST: db
      MEDIAWIKI_DB_USER: mediawiki
      MEDIAWIKI_DB_PASSWORD: YcBUxyP6tdKfyDEY
      MEDIAWIKI_DB_NAME: mediawiki

      # uncomment 'MEDIAWIKI_ENABLE_SSL' to enable SSL support
      # MEDIAWIKI_ENABLE_SSL: true

    networks:
      - mynetwork
networks:
  mynetwork:
    name: mynetwork
    external: true

Any ideas?

3
  • I doubt that dockerised MediaWiki, even its official edition, is already so production-ready that a novice can just take an image and use it. Better build your own image. Commented Aug 5, 2023 at 8:38
  • This would seem to make the official images rather useless. Commented Aug 7, 2023 at 15:26
  • Unfortunately, that's the thing about the blue-badged Docker Hub images. They're "Official" in that a Docker employee — presumably — created them. I had the same confusion.
    – Kevin E
    Commented May 30 at 14:12

1 Answer 1

0

Did you end up getting any farther along?

Here are some troubleshooting ideas, roughly in the order I'd try them if I were sitting at your computer.

  • docker compose up in its own terminal or tab; don't use -d / --detach so that you can monitor its output in the foreground
  • netstat -an | grep 8081
    • netstat comes in the net-tools package on Debian/Ubuntu systems
    • this helps you ascertain whether Docker is even running and redirecting the port
  • curl -I http://localhost:8081, like you already tried
  • docker compose logs to see if there are any obvious failures and docker compose logs --follow in one terminal tab/window while you curl in another
  • docker compose exec mediawiki bash (or sh if that doesn't work, since containers are just tiny Linux servers missing most of the tools you need)
    • ps aux | grep -iE (apache|fpm) to see if the web services are even running
    • inside the container, install net-tools and check to see if port 80 is even open with netstat -an | grep 80

Ordinarily, I'd recommend to tail -f /var/log/apache/error.log in one window/tab while curling the site in another, but for the "official" MediaWiki images on Docker Hub, error.log is a symlink to /dev/stderr and access.log to /dev/stdout, so you can just stick with docker compose logs in this instance.

Not being a Docker super-expert, I can't identify the problem just by looking, but I would try commenting out both networks sections, and pause on doing any nginx configuration for the proxy until you're able to reliably curl the site inside the container from the host running it.

The networks settings don't look wrong, but they're just adding unnecessary complexity in the initial phases of just trying to get a site to appear on localhost:8081.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.