mybb / docker

The official Dockerfile for the MyBB forum software.

Home Page:https://mybb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add information about how to access myBB after starting it with Docker Compose to the README.md file

opened this issue · comments

Could you please add information about how to access myBB once it has been launched with the Docker Compose file to the documentation? Which port/URL do you have to access to set it up?

Edit: I first tried accessing it on port 80 since the Docker Compose file suggests that that is where nginx is hosting it, but that only shows me the default "Welcome to nginx!" HTML page instead of the myBB setup page. Adding "/install" to the end URL didn't work either.

@kawaii Please clarify. Thank you!

@euantorano On port 80, nginx only serves the default "Welcome to nginx!" HTML page.

@euantorano Here you go:

version: '3.7'

services:
  mybb:
    image: mybb/mybb
    container_name: mybb
    restart: unless-stopped
    volumes:
    - /mnt/storage/docker/mybb:/var/www/html
    networks:
      proxy:
        ipv4_address: 172.30.0.29

  nginx:
    image: nginx:mainline
    container_name: nginx
    volumes:
    - /mnt/storage/docker/mybb:/var/www/html:ro
    networks:
      proxy:
        ipv4_address: 172.30.0.30

  postgres:
    image: postgres:10.4
    container_name: postgres
    volumes:
    - /mnt/storage/docker/postgres:/var/lib/postgresql/data:rw
    networks:
      proxy:
        ipv4_address: 172.30.0.31
    environment:
      - POSTGRES_DB=mybb
      - POSTGRES_USER=mybb
      - POSTGRES_PASSWORD=xou9huL88Eb5vNSatKQu

networks:
  proxy:
    external:
      name: proxy

This is all I saw in the logs:

Attaching to postgres, nginx, mybb
postgres    | The files belonging to this database system will be owned by user "postgres".
postgres    | This user must also own the server process.
postgres    |
postgres    | The database cluster will be initialized with locale "en_US.utf8".
postgres    | The default database encoding has accordingly been set to "UTF8".
postgres    | The default text search configuration will be set to "english".
postgres    |
postgres    | Data page checksums are disabled.
postgres    |
postgres    | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgres    | creating subdirectories ... ok
postgres    | selecting default max_connections ... 100
postgres    | selecting default shared_buffers ... 128MB
postgres    | selecting dynamic shared memory implementation ... posix
postgres    | creating configuration files ... ok
postgres    | running bootstrap script ... ok
postgres    | performing post-bootstrap initialization ... ok
postgres    |
postgres    | WARNING: enabling "trust" authentication for local connections
postgres    | You can change this by editing pg_hba.conf or using the option -A, or
postgres    | --auth-local and --auth-host, the next time you run initdb.
postgres    | syncing data to disk ... ok
postgres    |
postgres    | Success. You can now start the database server using:
postgres    |
postgres    |     pg_ctl -D /var/lib/postgresql/data -l logfile start
postgres    |
postgres    | waiting for server to start....2019-01-09 16:49:19.777 UTC [43] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres    | 2019-01-09 16:49:19.795 UTC [44] LOG:  database system was shut down at 2019-01-09 16:49:19 UTC
postgres    | 2019-01-09 16:49:19.800 UTC [43] LOG:  database system is ready to accept connections
postgres    |  done
postgres    | server started
postgres    | CREATE DATABASE
postgres    |
postgres    | CREATE ROLE
postgres    |
postgres    |
postgres    | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
postgres    |
postgres    | waiting for server to shut down...2019-01-09 16:49:20.254 UTC [43] LOG:  received fast shutdown request
postgres    | .2019-01-09 16:49:20.255 UTC [43] LOG:  aborting any active transactions
postgres    | 2019-01-09 16:49:20.258 UTC [43] LOG:  worker process: logical replication launcher (PID 50) exited with exit code 1
postgres    | 2019-01-09 16:49:20.258 UTC [45] LOG:  shutting down
postgres    | 2019-01-09 16:49:20.280 UTC [43] LOG:  database system is shut down
postgres    |  done
postgres    | server stopped
postgres    |
postgres    | PostgreSQL init process complete; ready for start up.
postgres    |
postgres    | 2019-01-09 16:49:20.370 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres    | 2019-01-09 16:49:20.370 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres    | 2019-01-09 16:49:20.372 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres    | 2019-01-09 16:49:20.385 UTC [70] LOG:  database system was shut down at 2019-01-09 16:49:20 UTC
postgres    | 2019-01-09 16:49:20.390 UTC [1] LOG:  database system is ready to accept connections
mybb        | MyBB not found in /var/www/html - copying now...
mybb        | Complete! MyBB 1819 has been successfully copied to /var/www/html
mybb        | [09-Jan-2019 16:49:17] NOTICE: fpm is running, pid 1
mybb        | [09-Jan-2019 16:49:17] NOTICE: ready to handle connections

When I access 172.30.0.29:80 in my browser, I get a 502 Bad Gateway error (not surprising since myBB isn't a webserver). When I access 172.30.30:80 on the other hand, I get the nginx default site I mentioned previously. Normally I would think that you could navigate to the install site by going to 172.30.0.30:80/install, but that just returns a 404 Not Found error.

@euantorano @kawaii I believe the reason why it isn't working is because this repository doesn't contain an nginx.conf file which tells nginx to serve myBB at a certain location. The old myBB Docker repository did contain one, not sure why it wasn't moved over to this new one. I'll try mapping it to the inside of the nginx container to see if that allows me to access myBB after running Docker Compose.

https://github.com/mybb/docker-compose/blob/master/nginx/mybb.conf

@euantorano @kawaii I can now confirm that that was indeed the issue. With the .conf mounted inside the nginx container, browsing to the container at port 80 now brings me to the myBB installation page.

I deliberately did not include the example nginx configuration from the deprecated mybb/docker-compose repository as I wanted to maintain a separation of concerns as such. This repository contains only what is needed to create a MyBB container, granted perhaps the example Compose/Stack snippet in the README.md is a little misleading.

In the future (once the Dockerfile for MyBB is "production ready") I'd like to supply ready-to-deploy stack files for Compose and Swarm - but that isn't likely until MyBB 1.9 or 1.10 comes around. The current Docker implementation is designed purely for testing and development IMO.

@kawaii Thanks for the explanation.