peterlu found the issue.
docker-compose.yml says
ports:
- 8080:80

after install, config.php needs a bit tweak:
change
'url' => 'http://localhost',
to
'url' => 'http://localhost:8080',

I think this is a Flarum bug (maybe I am wrong). I shouldn't need to tweak the config.php though.

nadi106 the average page load TTFB is at 6s (OMG) without data on some 3 years old mac. A brand new mac pro is running at 1.8s. Interesting to see how fast it runs on a server or Azure/AWS container.

    • [deleted]

    peterlu the average page load TTFB is at 6s

    WTF ?? 6 seconds ?? What is it - a calculator ?

      [deleted] Docker with default settings has issue with disk performance (Windows/Mac), result is a slow loading of the vendor folder (lot of small files).
      So it's Docker problem, not Flarum

      Options to fix it: http://blog.michaelperrin.fr/2017/04/14/docker-for-mac-on-a-symfony-app/

      I had a similar problem with Sylius eCommerce framework (Docker moved to Linux VM).
      Windows/Mac - 30-40 seconds page loading on i7 8700k, 16GB RAM, NVMe SSD.
      Linux - without problems.

        7 days later

        [deleted]
        now it is 6 seconds for page loading on a 7G azure production server, when this happens:
        https://discuss.flarum.org/d/22611-tags-module-fails-when-there-are-hundreds-or-thousands-of-tags

        When we do stress test with lots of posts, it is running ok. But when we run stress test with lots of tags, system/DB just hangs. Laravel framework (the base framework of Flarum) and the ORM model is known to have problems when the query is not written properly. We are looking into the problem to see if the Tags module can be refined. Maybe Flarum core product team can help look into it as well.

        Flarum is a very promising platform (it is PHP).

          peterlu
          We run Flarum on an on premise Kubernetes cluster on a small instance with 230 tags and no issues on performances (response time is around 500ms event if it is behind 2 reverse proxies). Maybe we do not reached the threshold of tags but we have probably much less cpu/memory capabilities than yours (1.8cpu, 3GB of ram).

          In your stress test the problem start to appear at which count of tags ?

            5 days later

            rdarcel try 10k primary tags, and 30k secondary tags(3 secondary tags per primary tag), you will see what I mean🙂 If 10k primary tags is too much for you, try 1k or 3k to start with.

            peterlu Maybe Flarum core product team can help look into it as well.

            It is certainly something we should look into. Will bring this to light for @Franz as well who is working on some performance improvements before stable.

            10 months later

            Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". You are running 7.2.34. in /var/www/vendor/composer/platform_check.php on line 24

              zhuhoudong this is an old tutorial (Flarum moves quickly from beta to beta and major breaking changes were released during 2020). It might not be compatible with the latest Flarum version.

              That being said, what command gives you the error you shared? Flarum does not (yet) requires PHP 7.3 as of beta 14, so it's probably another package that's causing the issue.

                zhuhoudong Hi, from the top of my head, try this:

                • edit the first line of flarum-fpm.dockerfile to update PHP version (from 7.2 to 7.3)
                • rebuild the image
                • run docker-compose up -d

                I think this should solve the PHP dependency issue.

                  nadi106 Thanks. New issue:

                  Warning: file_put_contents(/var/www/public/../storage/sessions/46OJsvuTjdB9XTW20dY3SdETwebCJpXXs1UbuPTZ): failed to open stream: Permission denied in /var/www/vendor/illuminate/filesystem/Filesystem.php on line 133

                  Fatal error: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Unable to emit response; headers already sent in /var/www/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:19 Stack trace: #0 /var/www/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(36): Laminas\HttpHandlerRunner\Exception\EmitterException::forHeadersSent() #1 /var/www/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(27): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput() #2 /var/www/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(98): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit(Object(Laminas\Diactoros\Response\HtmlResponse)) #3 /var/www/vendor/flarum/core/src/Http/Server.php(42): Laminas\HttpHandlerRunner\RequestHandlerRunner->run() #4 /var/www/public/index.php(22): Flarum\Http\Server->listen() #5 {main} thrown in /var/www/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php on line 19

                    zhuhoudong solved:

                    [root@monitorcenter flarum]# cd ..
                    [root@monitorcenter wwwroot]# chmod -R 777 flarum
                    [root@monitorcenter wwwroot]# cd flarum/

                      zhuhoudong chmod-ing with 777 permissions is not recommended and possesses a security concern. Consider fixing the issue by having the files owned by the proper user/group (sometimes www-data but may vary)

                        nadi106 The Docker Flarum is installed and ready to use. But how can I change the English interface to the Chinese interface?

                        Need to recreate the image, or is there any other way to install the plugin in the container? Thank you for your hint。

                          zhuhoudong install plugins using Composer. I believe plugins are installed in some directory under the git directory, so installing them regularly should work.