GithubHelp home page GithubHelp logo

mondediefr / docker-flarum Goto Github PK

View Code? Open in Web Editor NEW
478.0 12.0 127.0 249 KB

:speech_balloon: :whale: Docker image of Flarum

Home Page: https://hub.docker.com/r/mondedie/flarum

License: MIT License

Shell 79.23% Dockerfile 20.77%
docker flarum forum docker-flarum docker-image

docker-flarum's Introduction

mondedie/flarum

logo

Tag available

Features

  • Multi-platform image: linux/386, linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64
  • Lightweight & secure image
  • Based on Alpine Linux 3.16
  • nginx and PHP 8.0
  • Latest Flarum Framework (v1.3.0)
  • MySQL/Mariadb driver
  • OPCache extension configured

Build-time variables

Ports

  • Default: 8888 (configurable)

Volume

  • /flarum/app/extensions : Flarum extension directory
  • /flarum/app/public/assets : Flarum assets directory
  • /flarum/app/storage/logs : Flarum logs directory
  • /etc/nginx/flarum : Nginx location directory

Environment variables

Variable Description Type Default value
UID Flarum user id optional 991
GID Flarum group id optional 991
DEBUG Flarum debug mode optional false
FORUM_URL Forum URL required none
DB_HOST MariaDB instance ip/hostname optional mariadb
DB_USER MariaDB database username optional flarum
DB_NAME MariaDB database name optional flarum
DB_PASS MariaDB database password required none
DB_PREF Flarum tables prefix optional none
DB_PORT MariaDB database port optional 3306
FLARUM_PORT Port to run Flarum on inside the container optional 8888
UPLOAD_MAX_SIZE The maximum size of an uploaded file optional 50M
PHP_MEMORY_LIMIT PHP memory limit optional 128M
OPCACHE_MEMORY_LIMIT OPcache memory size in megabytes optional 128
LOG_TO_STDOUT Enable nginx and php error logs to stdout optional false
GITHUB_TOKEN_AUTH Github token to download private extensions optional false
PHP_EXTENSIONS Install additional php extensions optional none

Required environment variable for first installation

Variable Description Type Default value
FLARUM_ADMIN_USER Name of your user admin required none
FLARUM_ADMIN_PASS User admin password required none
FLARUM_ADMIN_MAIL User admin adress mail required none
FLARUM_TITLE Set a name of your flarum optional Docker-Flarum

Installation

1 - Pull flarum image

# Pull from hub.docker.com :
docker pull mondedie/flarum:latest

# or build it manually :
docker build -t mondedie/flarum:latest https://github.com/mondediefr/docker-flarum.git

2 - Docker-compose.yml

version: "3"

services:
  flarum:
    image: mondedie/flarum:stable
    container_name: flarum
    env_file:
      - /mnt/docker/flarum/flarum.env
    volumes:
      - /mnt/docker/flarum/assets:/flarum/app/public/assets
      - /mnt/docker/flarum/extensions:/flarum/app/extensions
      - /mnt/docker/flarum/storage/logs:/flarum/app/storage/logs
      - /mnt/docker/flarum/nginx:/etc/nginx/flarum
    ports:
      - 80:8888
    depends_on:
      - mariadb

  mariadb:
    image: mariadb:10.5
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=xxxxxxxxxx
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=xxxxxxxxxx
    volumes:
      - /mnt/docker/mysql/db:/var/lib/mysql

3 - Run it

You need a reverse proxy to access flarum, this is not described here. You can use the solution of your choice (Traefik, Nginx, Apache, Haproxy, Caddy, H2O...etc).

Create a environment file (see docker-compose: /mnt/docker/flarum/flarum.env here)

# vi /mnt/docker/flarum/flarum.env

DEBUG=false
FORUM_URL=http://domain.tld

# Database configuration
DB_HOST=mariadb
DB_NAME=flarum
DB_USER=flarum
DB_PASS=xxxxxxxxxx
DB_PREF=flarum_
DB_PORT=3306

# User admin flarum (environment variable for first installation)
# /!\ admin password must contain at least 8 characters /!\
FLARUM_ADMIN_USER=admin
FLARUM_ADMIN_PASS=xxxxxxxxxx
[email protected]
FLARUM_TITLE=Test flarum

Run your docker-compose

docker-compose up -d mariadb
# Wait a moment for the creation of the database
docker-compose up -d flarum
  • ⚠️ Your admin password must contain at least 8 characters (FLARUM_ADMIN_PASS).
  • If you get an error 500 with Something went wrong message, switch the DEBUG environment variable to true to see the actual error message in your browser.

flarum-home

Install additional php extensions

version: "3"

services:
  flarum:
    image: mondedie/flarum:stable
    container_name: flarum
    environment:
      - PHP_EXTENSIONS=gmp session brotli
    volumes:
      - /mnt/docker/flarum/assets:/flarum/app/public/assets
      - /mnt/docker/flarum/extensions:/flarum/app/extensions
      - /mnt/docker/flarum/storage/logs:/flarum/app/storage/logs
      - /mnt/docker/flarum/nginx:/etc/nginx/flarum

This example install php8-gmp php8-session and php8-brotli with apk
You can find a php extension here https://pkgs.alpinelinux.org/packages?name=php8-*&branch=v3.13&arch=x86_64

Install custom extensions

Flarum extensions list : https://flagrow.io/extensions

Install an extension

docker exec -ti flarum extension require some/extension

Remove an extension

docker exec -ti flarum extension remove some/extension

List all extensions

docker exec -ti flarum extension list

Custom vhost flarum nginx

File to change the vhost flarum /etc/nginx/flarum/custom-vhost-flarum.conf
To use file custom-vhost-flarum.conf add volume /etc/nginx/flarum Create file in /mnt/docker/flarum/nginx/custom-vhost-flarum.conf

# Example of custom vhost flarum for nginx
# fix nginx issue for fof/sitemap (https://github.com/FriendsOfFlarum/sitemap)

location = /sitemap.xml {
  try_files $uri $uri/ /index.php?$query_string;
}

Custom composer repositories

To use the composer repository system, add your repo name and json representation in /mnt/docker/flarum/extensions/composer.repositories.txt:

my_private_repo|{"type":"path","url":"extensions/*/"}
my_public_repo|{"type":"vcs","url":"https://github.com/my/repo"}

Example for a private repository in github

Add this in /mnt/docker/flarum/extensions/composer.repositories.txt

username|{"type":"vcs","url":"https://github.com/username/my-private-repo"}

Create a token in github with full control of privates repository
https://github.com/settings/tokens

Add your github token in var environment

GITHUB_TOKEN_AUTH=XXXXXXXXXXXXXXX

Add your repo in the list file /mnt/docker/flarum/extensions/list

username/my-private-repo:0.1.0

https://getcomposer.org/doc/03-cli.md#modifying-repositories

Guide for upgrade your flarum container

See the instructions here

License

Docker image mondedie/flarum is released under MIT License.

docker-flarum's People

Contributors

askvortsov1 avatar gunslinger23 avatar hardware avatar hydrog3n avatar magicalex avatar marty avatar ruibaby avatar sebastienhouzet avatar technowix avatar wait845 avatar wonderfall avatar xxxxxliil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-flarum's Issues

error - 404 page not found

I installed like this:

pull image:
docker pull mondedie/docker-flarum

run:
docker-compose up -d

When I try to visit the forum page: http://my-ip I get error: 404 page not found

I miss something or what?

how to correctly setup the reverse proxy

Hi,

I do not fully understand the step 3: reverse proxy.

  1. Should I provide these 4 files by myself?

    - /mnt/docker/nginx/sites-enabled:/sites-enabled
    - /mnt/docker/nginx/conf:/conf.d
    - /mnt/docker/nginx/log:/var/log/nginx
    - /mnt/docker/nginx/certs:/certs
    
  2. Is there a separated docker-compose.yml for nginx?

    (I guess not, but ask it here)

  3. Should I directly run docker exec -ti nginx ngxproxy (for reverse proxy) then docker-compose up -d (step 4 in README.md) in the same terminal? Or in separated terminals?

Thank you so much!

This will expose your database passwords, use this.

https://github.com/flarum/core/blob/master/src/Http/Server.php#L48

Modify the server.php in the Http core for this kind of code so it can log to a file and not print out the username, database name, password, etc. I had to shell into docker and get help on this but we were able to find it in 30 minutes and I wrote the code in 2 minutes!

    private function safelyBootAndGetHandler()
    {
        try {
            return $this->site->bootApp()->getRequestHandler();
        } catch (Throwable $e) {
            error_log($this->formatBootException($e), 3, "/var/tmp/my-errors.log");
            echo("Database is currently not available. See logs for more details.");
            exit(1);
        }
    }

SQLSTATE[HY000] [2002] No such file or directory

Something went wrong: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <h1>500 Internal Server Error</h1> <p>Something went wrong on our server.</p> </body> </html>

docker logs flarum:

[INFO] First launch, you must install flarum by opening your browser and setting database parameters.

docker exec -ti flarum tail -f /tmp/ngx_error.log:

nothing appears

docker exec -ti flarum tail -f /tmp/php_error.log:

[29-Jan-2018 22:02:08] NOTICE: fpm is running, pid 12
[29-Jan-2018 22:02:08] NOTICE: ready to handle connections

Installer shows up after docker-compose up

hi, I just installed Flarum but when I go to the configured URL the installer shows up again.

When I enter the credentials I entered in the flarum.env, an error occurs:

flarum_1   | In Connection.php line 669:
flarum_1   |                                                                                
flarum_1   |   SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'fl_migratio  
flarum_1   |   ns' already exists (SQL: create table `fl_migrations` (`migration` varchar(  
flarum_1   |   255) not null, `extension` varchar(255) null) default character set utf8mb4  
flarum_1   |    collate 'utf8mb4_unicode_ci' engine = InnoDB)                               
flarum_1   |                                                                                
flarum_1   | 
flarum_1   | In Exception.php line 18:
flarum_1   |                                                                                
flarum_1   |   SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'fl_migratio  
flarum_1   |   ns' already exists                                                           
flarum_1   |                                                                                
flarum_1   | 
flarum_1   | In PDOStatement.php line 115:
flarum_1   |                                                                                
flarum_1   |   SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'fl_migratio  
flarum_1   |   ns' already exists                                                           
flarum_1   |                                                                                
flarum_1   | 
flarum_1   | install [-f|--file FILE] [-c|--config CONFIG] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--] <command>
flarum_1   | 
flarum_1   | [INFO] End of flarum installation
flarum_1   | [INFO] First launch, installation...
flarum_1   | Installing Flarum...
flarum_1   | Connecting to database...failed
flarum_1   | Rolling back...
flarum_1   | 
flarum_1   | In Pipeline.php line 85:
flarum_1   |                
flarum_1   |   Step failed  
flarum_1   |                
flarum_1   | 
flarum_1   | In Exception.php line 18:
flarum_1   |                                              
flarum_1   |   SQLSTATE[HY000] [2002] Connection refused  
flarum_1   |                                              
flarum_1   | 
flarum_1   | In PDOConnection.php line 38:
flarum_1   |                                              
flarum_1   |   SQLSTATE[HY000] [2002] Connection refused

Seems to be the case that flarum wants to install itself on every launch…

shows private credentials

This shows private credentials when running in docker and using 'networks' as external. when it shows 'access denied' and throws the exception, no matter what I try, it shows the password to my database and all my info.

I've tried running bind mounts on php-fpm.conf, www.conf and php.ini after copying them from the image and pasting them back, it still shows all of my information if the database is down. The password is is cleartext form, not encrypted AT ALL. This is a major flaw as I've tried many things to fix it and nothing helps. Very compromising.

Unable to start container

Unable to start container, not sure why su-exec and config.sql is not being resolved - No such file or directory.

Any idea ?

flarum     | [INFO] First launch, installing flarum...
flarum     | sed: config.sql: No such file or directory
flarum     | su-exec: #: No such file or directory
flarum     | /usr/local/bin/run.sh: line 112: can't open config.sql: no such file
flarum     | [INFO] Installation done, launch flarum...
flarum     | chown: #: No such file or directory
flarum     | chown: Optional:991: No such file or directory
flarum     | chown: #: No such file or directory
flarum     | chown: Optional: No such file or directory
flarum     | su-exec: #: No such file or directory

Always getting the "Something went wrong" screen after setup

See the site here

This is my .env

DEBUG=true
FORUM_URL=https://forums.mylittlesky.net
LOG_TO_STDOUT=true

# Database configuration
DB_HOST=mariadb
DB_NAME=flarum
DB_USER=flarum
DB_PASS=flarum_password_here
DB_PREF=flarum_
DB_PORT=3306

# User admin flarum (environment variable for first installation)
# /!\ admin password must contain at least 8 characters /!\
FLARUM_ADMIN_USER=admin
FLARUM_ADMIN_PASS=passwordhere
[email protected]
FLARUM_TITLE=Crate Hackers Forum

And docker-compose:

version: "3"

services:
  flarum:
    image: mondedie/flarum:stable
    container_name: flarum
    env_file:
      - /database/docker/flarum/flarum.env
    volumes:
      - /database/docker/flarum/assets:/flarum/app/public/assets
      - /database/docker/flarum/extensions:/flarum/app/extensions
      - /database/docker/flarum/nginx:/etc/nginx/conf.d
    depends_on:
      - mariadb

  mariadb:
    image: mariadb:10.4
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=root_password
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=flarum_password_here
    volumes:
      - /database/docker/mysql/db:/var/lib/mysql

I don't run Nginx on my system, but Caddy so I'm not sure what the /etc/nginx/conf.d volume is for, or is that maybe the problem?

Also I'm not sure how I can see more debug logging. I've enabled both DEBUG and LOG_TO_STDOUT but I don't see any extra logs.

Startup and install slow due to chown

Whenever the docker container is started, every folder and file in /flarum is chown'ed to a special user created for running flarum (UID 991 by default). This is extremely slow, and if multiple extensions are installed, can take multiple minutes to complete.

Can't connect to the docker

I get no output from ~/flarumdocker # docker container logs flarum

my docker-compose.yml:

version: '2'

services:
  flarum:
    image: mondedie/docker-flarum:0.1.0-beta.7.1-stable
    container_name: flarum
    labels:
      - traefik.enable=false
    environment:
      - FORUM_URL=http://forum.123.eu
      - DB_PASS=APassword
      - DEBUG=true
    volumes:
      - /mnt/docker/flarum/assets:/flarum/app/assets
      - /mnt/docker/flarum/extensions:/flarum/app/extensions
    depends_on:
      - mariadb
    ports:
      - "8888:8888"

  mariadb:
    image: mariadb:10.1
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=LOLOLOLOLOLO
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=APassword
    volumes:
      - /mnt/docker/mysql/db:/var/lib/mysql

Docker Version
Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:17:21 2018
OS/Arch: linux/amd64

Server:
Engine:
Version: 17.12.1-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:15:56 2018
OS/Arch: linux/amd64
Experimental: false

Docker-Compose Version
docker-compose version 1.8.0, build unknown

I try to connect via firefox an curl on the url like
curl 127.0.0.1:8888 and get curl: (56) Recv failure: Connection reset by peer

Image removed from Docker Hub

Hello,

Just found out today that your image is no longer available.

Pulling flarum (mondedie/docker-flarum:0.1.0-beta.8.1-stable)...
pull access denied for mondedie/docker-flarum, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

Furthermore, https://hub.docker.com/r/mondedie/docker-flarum leads to a 404.

Nginx: permissions denied

When trying to run following the instruction in readme, I get this error:
nginx: [alert] could not open error log file: open() "/var/lib/nginx/logs/error.log" failed (13: Permission denied)

Access denied for user 'flarum'@'172.24.0.5'

docker-compose up output

root@ip-172-31-8-177:/srv/Docker/Flarum# docker-compose down && rm -r Data/ && docker-compose up
Removing flarum  ... done
Removing mariadb ... done
Network reverseproxy_default is external, skipping
Creating mariadb ... done
Creating flarum  ... done
Attaching to mariadb, flarum
mariadb    | 2019-10-26 23:05:33 0 [Note] mysqld (mysqld 10.4.8-MariaDB-1:10.4.8+maria~bionic) starting as process 1 ...
flarum     | [INFO] First launch, installation...
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Using Linux native AIO
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Uses event mutexes
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Number of pools: 1
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Using SSE2 crc32 instructions
mariadb    | 2019-10-26 23:05:33 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Completed initialization of buffer pool
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mariadb    | 2019-10-26 23:05:33 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=23661625
mariadb    | 2019-10-26 23:05:34 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
mariadb    | 2019-10-26 23:05:34 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
mariadb    | 2019-10-26 23:05:34 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mariadb    | 2019-10-26 23:05:34 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mariadb    | 2019-10-26 23:05:34 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mariadb    | 2019-10-26 23:05:34 0 [Note] InnoDB: 10.4.8 started; log sequence number 23661634; transaction id 17567
mariadb    | 2019-10-26 23:05:34 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mariadb    | 2019-10-26 23:05:34 0 [Note] Plugin 'FEEDBACK' is disabled.
mariadb    | 2019-10-26 23:05:34 0 [Note] Server socket created on IP: '::'.
mariadb    | 2019-10-26 23:05:34 0 [Warning] 'proxies_priv' entry '@% root@8fcb80558ea1' ignored in --skip-name-resolve mode.
mariadb    | 2019-10-26 23:05:34 0 [Note] Reading of all Master_info entries succeeded
mariadb    | 2019-10-26 23:05:34 0 [Note] Added new Master_info '' to hash table
mariadb    | 2019-10-26 23:05:34 0 [Note] mysqld: ready for connections.
mariadb    | Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
mariadb    | 2019-10-26 23:05:34 0 [Note] InnoDB: Buffer pool(s) load completed at 191026 23:05:34
flarum     | Installing Flarum...
mariadb    | 2019-10-26 23:05:45 8 [Warning] Access denied for user 'flarum'@'172.24.0.5' (using password: YES)
flarum     | Connecting to database...failed
flarum     | Rolling back...
flarum     | 
flarum     | In Pipeline.php line 87:
flarum     |                
flarum     |   Step failed  
flarum     |                
flarum     | 
flarum     | In PDOConnection.php line 31:
flarum     |                                                                                
flarum     |   SQLSTATE[HY000] [1045] Access denied for user 'flarum'@'172.24.0.5' (using   
flarum     |   password: YES)                                                               
flarum     |                                                                                
flarum     | 
flarum     | In PDOConnection.php line 27:
flarum     |                                                                                
flarum     |   SQLSTATE[HY000] [1045] Access denied for user 'flarum'@'172.24.0.5' (using   
flarum     |   password: YES)                                                               
flarum     |                                                                                
flarum     | 
flarum     | install [-f|--file FILE] [-c|--config CONFIG]
flarum     | 
flarum     | [INFO] End of flarum installation

flarum.env output

root@ip-172-31-8-177:/srv/Docker/Flarum# cat flarum.env

DEBUG=true
FORUM_URL=http://forums.motorboards.tech

Database configuration
DB_HOST=mariadb
DB_NAME=flarum
DB_USER=flarum
DB_PASS=testing123
DB_PREF=flarum_
DB_PORT=3306

User admin flarum (environment variable for first installation)
/!\ admin password must contain at least 8 characters /!
FLARUM_ADMIN_USER=TrevorKSmith
FLARUM_ADMIN_PASS=testing123
FLARUM_ADMIN_MAIL=[email protected]
FLARUM_TITLE=Motorboards Tech

cat docker-compose.yml output

root@ip-172-31-8-177:/srv/Docker/Flarum# cat docker-compose.yml
version: "3"

services:
flarum:
image: mondedie/docker-flarum:latest
container_name: flarum
env_file:
- ./flarum.env
volumes:
- ./Data/assets:/flarum/app/public/assets
- ./Data/extensions:/flarum/app/extensions
- ./Data/nginx:/etc/nginx/conf.d
depends_on:
- mariadb

mariadb:
image: mariadb:10.4
container_name: mariadb
environment:
- MYSQL_ROOT_PASSWORD=testing123
- MYSQL_DATABASE=flarum
- MYSQL_USER=flarum
- MYSQL_PASSWORD=testing123
volumes:
- ./Data/db:/var/lib/mysql

networks:
default:
external:
name: reverseproxy_default

http on config.php even though I defined an https on .env

Hello, I installed your container and after configuring the reverse proxy with nginx and SSL, after installing the forum, I ran into a problem

The forum homepage was blank with only the forums title, using Chrome developer console I saw this

'https://foro.lug.fi.uba.ar/' was loaded over HTTPS, but requested an insecure stylesheet 'http://foro.lug.fi.uba.ar/assets/forum-6c6cf9f4.css'. This request has been blocked; the content must be served over HTTPS.

After searching a little on Flarum own forum, I found that you have to change http for https on the config.php file

After changing http for https it works as it should.

The thing is that I explicitly definen a https FORUM_URL on the .env file for docker compose

It is supposed to put exactly that url on the config.php file?

send email error

image

error:
image

response:(debug: true)
{"errors":[{"code":500,"title":"Internal server error"}]}

username and password is correct

dbdata(setting):
+--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| key | value |
+--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| allow_post_editing | reply |
| allow_renaming | 10 |
| allow_sign_up | 1 |
| custom_less | |
| default_locale | en |
| default_route | /all |
| extensions_enabled | ["flarum-approval","flarum-bbcode","flarum-emoji","flarum-english","flarum-flags","flarum-likes","flarum-lock","flarum-markdown","flarum-mentions","flarum-sticky","flarum-subscriptions","flarum-suspend","flarum-tags"] |
| flarum-tags.max_primary_tags | 1 |
| flarum-tags.max_secondary_tags | 3 |
| flarum-tags.min_primary_tags | 1 |
| flarum-tags.min_secondary_tags | 0 |
| forum_description | |
| forum_title | ------- |
| mail_driver | smtp |
| mail_encryption | ssl |
| mail_from | [email protected] |
| mail_host | smtp.exmail.qq.com |
| mail_password | ---- |
| mail_port | 465 |
| mail_username | ---- |
| theme_colored_header | 0 |
| theme_dark_mode | 0 |
| theme_primary_color | #4D698E |
| theme_secondary_color | #4D698E |
| version | 0.1.0-beta.7.2 |
| welcome_message | This is beta software and you should not use it in production. |
| welcome_title | Welcome to ------ |

0.1.0-beta.15

Thank you for maintaining this docker image!
Could you please make a tag for the recent beta 15?

After docker-compose down and docker-compose up only bad gateway, no debug, no LOG_TO_STDOUT

Hi there, title says most of the problem.

I run flarum with traefik. Installation went fine. I also installed some extensions. Then I wanted to test persistence by going docker-compose down and docker-compose up -d but I only get bad gateway now, even though DEBUG=true and LOG_TO_STDOUT=true (there are no logs in /var/log/nginx or /var/log/php7).

PHP_EXTENSIONS also seems to do weird things, brotli gets installed in the beginning but then it also says

[InvalidArgumentException]
Could not find package brotli[NAME_OF_FIRST_INSTALLED_FLARUM_EXTENSION_HERE].

Did you mean one of these?
...

If I move the first installed flarum extension from the list down one line it instead says "Could not find package brotli".

Any idea why I get bad gateway and debugging or logging just doesn't happen?

EDIT: At the ~15th try for some reason after 10 minutes of waiting the site worked. I'll try if it really is about waiting.

EDIT2: So if I keep PHP_EXTENSIONS it ignores the extensions in the extensions list. (Doesn't install them on startup.) It does seem to start now, though. It just takes a while without any indication whatsoever in any logs about it.

EDIT3: Removing PHP_EXTENSIONS makes the extension-installation work again.

Install Flarum Fail,please help

my stack yml

version: "3"
services:
  flarum:
    image: mondedie/flarum:stable
    ports:
      - 80:8888
    environment:
      DEBUG: 'false'
      FORUM_URL: http://192.168.100.100
      DB_HOST: mariadb
      DB_NAME: flarum
      DB_USER: flarum
      DB_PASS: flarum
      DB_PREF: flarum_
      DB_PORT: 3306
      FLARUM_ADMIN_USER: admin
      FLARUM_ADMIN_PASS: admin123456
      FLARUM_ADMIN_MAIL: [email protected]
      FLARUM_TITLE: Test Flarum
      
    volumes:
      - flarum-assets:/flarum/app/public/assets
      - flarum-extensions:/flarum/app/extensions
      - flarum-nginx:/etc/nginx/conf.d
    depends_on:
      - mariadb

  mariadb:
    image: mariadb:10.4
    environment:
      - MYSQL_ROOT_PASSWORD=flarum
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=flarum
    ports:
      - 33306:3306
    volumes:
      - mariadb-data:/var/lib/mysql
volumes:
  mariadb-data:
  flarum-assets:
  flarum-extensions:
  flarum-nginx:

Bad Gateway

I followed the README for the install and everything seems to work fine

flarum        | [INFO] First launch, installation...
flarum        | Installing Flarum...
flarum        | Connecting to database...done
flarum        | Writing config file...done
flarum        | Running migrations...done
flarum        | Writing default settings...done
flarum        | Creating admin user admin...done
flarum        | Publishing all assets...done
flarum        | Enabling bundled extensions...done
flarum        | DONE.
flarum        | [INFO] End of flarum installation

But I used Nginx Proxy Manager for my reverse proxy, and by pointing on the 8888 it only gives me à 502 Bad Gateway from Nginx. Does someone have an idea from where it migth come from ?

Error 500 Installation Flarum

I have error 500 when i tried to install Flarum :

image

My conf file :

flarum:
  image: mondedie/docker-flarum:0.1.0-beta.6-stable
  container_name: flarum
  links:
    - mariadb:mariadb
  environment:
    - FORUM_URL=https://discuss.domain.fr
    - DB_PASS=AtEQ8832q7xWmyM
  volumes:
    - /mnt/docker/flarum/assets:/flarum/app/assets
    - /mnt/docker/flarum/extensions:/flarum/app/extensions

mariadb:
  image: mariadb:10.1
  container_name: mariadb
  volumes:
    - /mnt/docker/mysql/db:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=AtEQ8832q7xWmyM
    - MYSQL_DATABASE=flarum
    - MYSQL_USER=flarum
    - MYSQL_PASSWORD=AtEQ8832q7xWmyM

docker ps

root@vps284653:~# docker ps
CONTAINER ID        IMAGE                                        COMMAND                  CREATED             STATUS              PORTS               NAMES
5075fab18ed5        mondedie/docker-flarum:0.1.0-beta.6-stable   "run.sh"                 7 minutes ago       Up 7 minutes        8888/tcp            flarum
8f68c0f40ed9        mariadb:10.1                                 "docker-entrypoint.sh"   7 minutes ago       Up 7 minutes        3306/tcp            mariadb

No information in docker exec -ti flarum cat /tmp/ngx_error.log

Nginx

server {
    listen 80; listen [::]:80;
    server_name discuss.domain.fr;  # <-- change this

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;  listen [::]:443 ssl;
    server_name discuss.domain.fr;  # <-- change this

    ssl on;
    ssl_certificate /etc/nginx/ssl/public.pem;
    ssl_certificate_key /etc/nginx/ssl/private.pem;

    location / {
        proxy_pass http://172.17.0.3:8888;
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Une idée ?

It is impossible to use this image from scratch

There is a lot of things to do to be able to use this image from scratch :

  • remove custom error page 500 that prevent you to understand troubles : docker-compose exec flarum sh; remove line 12 in /nginx/sites-enabled/flarum.conf; wait for the chown to or reload nginx if allready started with kill -HUP 13
  • database :
  • use mysql 5 until flarum/framework#1211 is resolved
  • if the was a failure with the database, drop it since schema is already created : docker-compose exec mariadb mysql -pxxxxxxxx -e 'drop database flarum; create database flarum;'
  • open your browser and fulfil the form
  • the database will be initialized, and there will be 2 new files : /flarum/app/assets/rev-manifest.json and /flarum/app/config.php

You will then a 504 Gateway Time-out from nginx (flarum container), because php-fpm process doesn't end.

how to install extension by docker-flarum

Upgrade of container results in lost database config

I'm running this container in rancher. I upgraded the container and changed a label by doing so (to increase php upload limit) which resulted in loss of database config.
It's as if the environment variables for database settings do nothing at all.

When trying to enter the old database settings I get this with DEBUG=true:
grafik

What should I do so the container keeps the database settings?

This is my docker-compose:

version: '2'

volumes:
  flarum-vol:
    driver: local
  flarum-mariadb-vol:
    driver: local
    
services:
  flarum:
    image: mondedie/docker-flarum:0.1.0-beta.7.1-stable
    container_name: flarum
    ports:
      - 8888
    labels:
      rap.le_email: XXXXXXX
      rap.port: '8888'
      io.rancher.scheduler.affinity:host_label: XXXXX=XXXXX
      rap.le_host: XXXXXXX
      rap.client_max_body_size: 150M
      io.rancher.container.pull_image: always
      rap.host: XXXXXXXX
    environment:
      - FORUM_URL=https://XXXXXXX
      - DB_PASS=XXXXXXX
      - DB_USER=flarum
      - DB_PREF=flarum_
      - DB_HOST=mariadb
    volumes:
      - flarum-vol:/flarum/app/
    links:
      - mariadb

  mariadb:
    image: mariadb:10.1
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=XXXXXXXXX
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=XXXXXXX
    volumes:
      - flarum-mariadb-vol:/var/lib/mysql
    labels:
      io.rancher.container.pull_image: always
      io.rancher.scheduler.affinity:host_label: XXXXXX=XXXXXX

Docker Compose build problem

Hey guys ! I'm trying to run this image on my docker, so followed the README, but I keep getting

ERROR: manifest for mondedie/flarum:stable not found: manifest unknown: manifest unknown

My docker-compose.yml is as follows

version: "3"

services:
  flarum:
    image: mondedie/flarum:stable
    container_name: flarum
    env_file:
      - ./flarum/flarum.env
    volumes:
      - ./flarum/assets:/flarum/app/public/assets
      - ./flarum/extensions:/flarum/app/extensions
      - ./flarum/nginx:/etc/nginx/conf.d
    depends_on:
      - mariadb

  mariadb:
    image: mariadb:10.4
    container_name: mariadb
    ports:
      - 3307:3306
    environment:
      - MYSQL_ROOT_PASSWORD=dzqdzqdzq
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=qzdqdqdzqd
    volumes:
      - /mnt/docker/mysql/db:/var/lib/mysql

Thx for your help 😄

Error 404 on assets

I am running several containers behind a nginx reverse proxy with SSL encryption.
I have just simply redirected www.example.com/flarum to the exposed port of docker-flarum container:

listen    443;
server_name  example.com;

location /flarum {
    proxy_pass http://127.0.0.1:8888;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

After starting docker-compose I had the expected Flarum starting screen.
After that I had a mixed-content error that I fixed by modifying config.php, from:
'url' => 'http://www.example.com/community'
to
'url' => 'httpS://www.example.com/community'

However, now I am facing a 404 error on assets (although they are in assets folder).

I am new to flarum so I don't know what to do. I suspect a nginx rule missing ...

Thanks in advance for any help !

Config not persisted

Am I doing something wrong? Every time I recreate the docker the config file is lost because it's not "volumed up". I assume I'm doing something wrong as the examples here seem rather complete

Can't install flarum

When I click the install flarum button, I keep getting an internal error. I entered mariadb as the MySQL host, flarum as the database and the username and test123 as the password. Is there any way I can get the logs of the server? My docker version is 1.11.1 and the only output I get from the flarum container is:

flarum     | [INFO] First launch, you must install flarum by opening your browser and setting database parameters.

Docker-composle.yml:

flarum:
  image: mondedie/docker-flarum
  container_name: flarum
  links:
    - mariadb:mariadb
  environment:
    - FORUM_URL=http://76.105.7.45:3991
    - DB_PASS=test123
    - DEBUG=true
  volumes:
    - /mnt/docker/flarum/assets:/flarum/app/assets
    - /mnt/docker/flarum/extensions:/flarum/app/extensions

#- /mnt/docker/flarum/config.php:/flarum/app/config.php

mariadb:
  image: mariadb:10.1
  container_name: mariadb
  volumes:
    - /mnt/docker/mysql/db:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=test123
    - MYSQL_DATABASE=flarum
    - MYSQL_USER=flarum
    - MYSQL_PASSWORD=test123

nginx:
  image: wonderfall/boring-nginx
  container_name: nginx
  links:
    - flarum:flarum
  ports:
    - "3991:8000"
    - "443:4430"
  volumes:
    - /mnt/docker/nginx/sites-enabled:/sites-enabled
    - /mnt/docker/nginx/conf:/conf.d
    - /mnt/docker/nginx/log:/var/log/nginx
    - /mnt/docker/nginx/certs:/certs

nginx.conf error

nginx: [emerg] unexpected "}" in /etc/nginx/nginx.conf:137

missing a symbol ;

sendmail?

So, under current circumstance, we must use an external smtp service to get mailing work.

How to make it work with driver=mail (that is, sending mails from local machine/container)?

error installation

1. The /flarum/app directory is not writable.
2. sed: /flarum/app/config.php: No such file or directory

"docker exec -ti nginx ngxproxy" 's issues

Hi guys, when I install Flarum this afternoon, I try to setup proxy by running this command: "docker exec -ti nginx ngxproxy" . But the terminal ask me enter Certificate path without stop. Looks like this 👇
image

I tried server times, but all happens like this. : (

And the configure file in my docker-composer.yml is like this :

flarum:
  image: mondedie/docker-flarum:0.1.0-beta.6-stable
  container_name: flarum
  links:
    - mariadb:mariadb
  environment:
    - FORUM_URL=https://www.ueec10.com
    - DB_PASS=hello123
  volumes:
    - /mnt/docker/flarum/assets:/flarum/app/assets
    - /mnt/docker/flarum/extensions:/flarum/app/extensions

mariadb:
  image: mariadb:10.1
  container_name: mariadb
  volumes:
    - /mnt/docker/mysql/db:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=hello123
    - MYSQL_DATABASE=flarum
    - MYSQL_USER=flarum
    - MYSQL_PASSWORD=hello123


nginx:
  image: wonderfall/boring-nginx
  container_name: nginx
  links:
    - flarum:flarum
  ports:
    - "80:8000"
    - "443:4430"
  volumes:
    - /mnt/docker/nginx/sites-enabled:/sites-enabled
    - /mnt/docker/nginx/conf:/conf.d
    - /mnt/docker/nginx/log:/var/log/nginx
    - /mnt/docker/nginx/certs:/certs

Hope your reply, how to enter " Certificate key path" after "Certificate key path" :)

Directory permissions: "The /flarum/app directory is not writable."

As of the latest version, I get the same permission errors as reported in #36
The full error I get is:

flarum            | [INFO] First launch, installation...
flarum            | Please fix the following errors before we can continue with the installation.
flarum            | The /flarum/app directory is not writable.
flarum            | Please chmod this directory and its contents to 0775.
flarum            | [INFO] End of flarum installation

During the many tests I've done, it also complains about the /flarum/app/public/assets directory.
I simplified the docker-compose.yml file to the following:

version: '3'

services:
    flarum:
        image: flarum-git
        container_name: flarum
        environment:
            - FORUM_URL=http://localhost:8888
            - DB_PASS=xxxxxx
            - DEBUG=true
            - FLARUM_ADMIN_USER=admin
            - FLARUM_ADMIN_PASS=xxxxxxx
            - FLARUM_ADMIN_MAIL=xxxxxxxxxx
        volumes:
            - /flarum/app/public/assets
            - /flarum/app/extensions
        depends_on:
            - flarum_mariadb

    flarum_mariadb:
        image: mariadb:10.2
        container_name: flarum_mariadb
        volumes:
            - /var/lib/mysql
        environment:
            - MYSQL_ROOT_PASSWORD=xxxxxxxxxx
            - MYSQL_DATABASE=flarum
            - MYSQL_USER=flarum
            - MYSQL_PASSWORD=xxxxxxxx

I have noted that if I the stop it right after that error, remove the installed.txt file and re-run docker-compose up, it does work in some combinations of permissions on the volumes that I can not even remember exactly given that I have tried so many that I can't recall!

I also tried setting the GID and ID variables to my host user's value and chowning the volumes accordingly, to no avail.

Can anyone try and see if it's possible to reproduce?
Pull this image, copy/paste the file above, change the image name to the one you pull, edit the environnment variables, run it with docker-compose up, without -d to keep the logs foreground!

Add support for Bazaar

The marketplace extension that allows you to add and remove extensions without composer or a terminal.

https://flagrow.io/
https://github.com/flagrow/bazaar/

Error after Bazaar installation :

2018/04/13 20:25:19 [error] 32#32: *28 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ReflectionException: Class Flagrow\Bazaar\Listeners\AddApiControllers does not exist in /flarum/app/vendor/illuminate/container/Container.php:741
Stack trace:
#0 /flarum/app/vendor/illuminate/container/Container.php(741): ReflectionClass->__construct('Flagrow\\Bazaar\\...')
#1 /flarum/app/vendor/illuminate/container/Container.php(631): Illuminate\Container\Container->build('Flagrow\\Bazaar\\...', Array)
#2 /flarum/app/vendor/flarum/core/src/Foundation/Application.php(514): Illuminate\Container\Container->make('Flagrow\\Bazaar\\...', Array)
#3 /flarum/app/vendor/illuminate/events/Dispatcher.php(149): Flarum\Foundation\Application->make('Flagrow\\Bazaar\\...')
#4 /flarum/app/vendor/illuminate/events/Dispatcher.php(135): Illuminate\Events\Dispatcher->resolveSubscriber('Flagrow\\Bazaar\\...')
#5 /flarum/app/vendor/flagrow/bazaar/bootstrap.php(9): Illuminate\Events\Dispatcher->subscribe('Flagrow\\Bazaar\\...')
#6 [internal function]: Flarum\Extension\ExtensionServiceProv" while reading response header from upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "127.0.0.1:8888"

Issue opened here : extiverse/bazaar#110

Table 'flarum.settings' doesn't exist

Hi, after filling the installation form, I got 504: Gateway timeout error. The compose file I used is

version: '2'
services:
  flarum:
    image: mondedie/docker-flarum
    container_name: flarum
    labels:
      - traefik.frontend.rule=Host:dell123.flarum
    environment:
      - FORUM_URL=http://dell123.flarum
      - DB_PASS=123456
      - DEBUG=true
    volumes:
      - flarum_assets:/flarum/app/assets
      - flarum_extensions:/flarum/app/extensions
    depends_on:
      - flarum_mariadb
  flarum_mariadb:
    image: mariadb:10.1
    container_name: flarum_mariadb
    volumes:
      - flarum_mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=123456
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=123456

Add instructions for running nginx

Is there any instruction on running proxy or everyone is expected to figure out on their own?

Maybe providing working default setup (nginx, for example) will do well for 80% of users, and 20% who want to use their own setup (Apache, Caddy, etc) will always be able to change and replace the docker-compose config.

The idea of docker-compose is to lower configuration and running pain to the virtually zero level, after all. And currently every single user has to figure out how to setup and configure the proxy, and that can take hours of googling and guesswork.

What do you think?

Old PHP version makes it impossible to use some plugins

e.g. https://extiverse.com/extension/fof/discussion-language requires PHP 7.4.0, I'm getting the following error message:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - rinvex/countries v7.3.0 requires php ^7.4.0 -> your PHP version (7.3.19) does not satisfy that requirement.
    - rinvex/countries v7.2.0 requires php ^7.4.0 -> your PHP version (7.3.19) does not satisfy that requirement.
    - rinvex/countries v7.1.0 requires php ^7.4.0 -> your PHP version (7.3.19) does not satisfy that requirement.
    - rinvex/countries v7.0.1 requires php ^7.4.0 -> your PHP version (7.3.19) does not satisfy that requirement.
    - fof/discussion-language 0.1.2 requires rinvex/countries ^7.0.1 -> satisfiable by rinvex/countries[v7.0.1, v7.1.0, v7.2.0, v7.3.0].
    - Installation request for fof/discussion-language ^0.1.2 -> satisfiable by fof/discussion-language[0.1.2].


Installation failed, reverting ./composer.json to its original content.

Do not update extensions on container restart

Hello!
Is it possible not to update extensions every time the container is restarted? What is it for? When there are many extensions, restarting takes a long time. With 12 extensions step "Updating dependencies (including require-dev)" takes 40 seconds.

PHP Fatal error: Allowed memory size exhausted

When trying to run

docker exec -ti flarum_flarum_1 extension require fof/links

I get the following error

PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

I already have PHP_MEMORY_LIMIT: 1G set in my docker-compose.yml which gets applied correctly

/ # cat /etc/php7/php-fpm.conf | grep memory_limit
php_admin_value[memory_limit] = 1G

I tried upgrading composer to the latest 1.x which did not fix it and 2.x is not compatible with flarum (?).
The host still has 11gb available.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.