iredmail / dockerized

Official dockerized iRedMail.
https://www.iredmail.org/
281 stars 71 forks source link

mlmmjadmin (exit status 1; not expected) #10

Closed TitanFighter closed 4 years ago

TitanFighter commented 4 years ago

Hi @iredmail

Testing the latest version and there is an error:

root@mail:/var/www/mail/src# ./run_all_in_one.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/mariadb.sh 
[iRedMail] Starting temporary MariaDB instance.
2020-03-25 11:13:03 0 [Note] mysqld (mysqld 10.4.12-MariaDB-log) starting as process 11 ...
[iRedMail] Reset password for SQL user 'root'.
[iRedMail] [Run] /docker/mariadb/pre_start/0-vmail_db.sh
[iRedMail] Grant privileges to SQL user 'vmail' and 'vmailadmin'.
[iRedMail] Make sure postmaster@ryzum.com is a global admin.
[iRedMail] [Run] /docker/mariadb/pre_start/amavisd_db.sh
[iRedMail] [Run] /docker/mariadb/pre_start/fail2ban_db.sh
[iRedMail] [Run] /docker/mariadb/pre_start/iredapd_db.sh
[iRedMail] [Run] /docker/mariadb/pre_start/roundcube.sh
[iRedMail] [Entrypoint] /docker/entrypoints/dovecot.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/postfix.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmj.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmjadmin.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/iredapd.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/antispam.sh 
[iRedMail] Run 'sa-update' (required by Amavisd).
Update finished, no fresh updates were available
[iRedMail] [Entrypoint] /docker/entrypoints/nginx.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/phpfpm.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/roundcube.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/fail2ban.sh 
[iRedMail] CMD: /usr/bin/supervisord -c /etc/supervisord.conf
2020-03-25 11:13:07,840 INFO Included extra file "/etc/supervisor.d/amavisd.conf" during parsing
2020-03-25 11:13:07,840 INFO Included extra file "/etc/supervisor.d/clamav.conf" during parsing
2020-03-25 11:13:07,841 INFO Included extra file "/etc/supervisor.d/cron.conf" during parsing
2020-03-25 11:13:07,841 INFO Included extra file "/etc/supervisor.d/dovecot.conf" during parsing
2020-03-25 11:13:07,841 INFO Included extra file "/etc/supervisor.d/fail2ban.conf" during parsing
2020-03-25 11:13:07,841 INFO Included extra file "/etc/supervisor.d/iredapd.conf" during parsing
2020-03-25 11:13:07,842 INFO Included extra file "/etc/supervisor.d/mariadb.conf" during parsing
2020-03-25 11:13:07,842 INFO Included extra file "/etc/supervisor.d/mlmmjadmin.conf" during parsing
2020-03-25 11:13:07,842 INFO Included extra file "/etc/supervisor.d/nginx.conf" during parsing
2020-03-25 11:13:07,842 INFO Included extra file "/etc/supervisor.d/phpfpm.conf" during parsing
2020-03-25 11:13:07,843 INFO Included extra file "/etc/supervisor.d/postfix.conf" during parsing
2020-03-25 11:13:07,843 INFO Included extra file "/etc/supervisor.d/rsyslog.conf" during parsing
2020-03-25 11:13:07,843 INFO Set uid to user 0 succeeded
2020-03-25 11:13:07,857 INFO RPC interface 'supervisor' initialized
2020-03-25 11:13:07,857 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2020-03-25 11:13:07,858 INFO supervisord started with pid 1
2020-03-25 11:13:08,861 INFO spawned: 'rsyslog' with pid 329
2020-03-25 11:13:08,864 INFO spawned: 'cron' with pid 330
2020-03-25 11:13:08,874 INFO spawned: 'mariadb' with pid 331
2020-03-25 11:13:08,882 INFO spawned: 'clamav' with pid 332
2020-03-25 11:13:08,894 INFO spawned: 'dovecot' with pid 333
2020-03-25 11:13:08,910 INFO spawned: 'mlmmjadmin' with pid 336
2020-03-25 11:13:08,918 INFO spawned: 'iredapd' with pid 338
2020-03-25 11:13:08,943 INFO spawned: 'amavisd' with pid 340
2020-03-25 11:13:08,954 INFO spawned: 'phpfpm' with pid 341
2020-03-25 11:13:08,986 INFO spawned: 'postfix' with pid 342
2020-03-25 11:13:09,014 INFO spawned: 'nginx' with pid 343
2020-03-25 11:13:09,027 INFO spawned: 'fail2ban' with pid 344
2020-03-25 11:13:09,066 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,078 INFO success: cron entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,080 INFO success: mariadb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,082 INFO success: clamav entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,083 INFO success: dovecot entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,083 INFO success: mlmmjadmin entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,083 INFO success: iredapd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,084 INFO success: amavisd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,089 INFO success: phpfpm entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,090 INFO success: postfix entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,092 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,092 INFO success: fail2ban entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,123 INFO exited: mlmmjadmin (exit status 1; not expected)
2020-03-25 11:13:09,142 INFO spawned: 'mlmmjadmin' with pid 350
2020-03-25 11:13:09,220 INFO success: mlmmjadmin entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,390 INFO exited: mlmmjadmin (exit status 1; not expected)
2020-03-25 11:13:09,651 INFO spawned: 'mlmmjadmin' with pid 392
2020-03-25 11:13:09,665 INFO success: mlmmjadmin entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,803 INFO exited: iredapd (exit status 1; not expected)
2020-03-25 11:13:09,819 INFO spawned: 'iredapd' with pid 396
2020-03-25 11:13:09,835 INFO success: iredapd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:09,840 INFO exited: mlmmjadmin (exit status 1; not expected)
2020-03-25 11:13:09,842 INFO spawned: 'mlmmjadmin' with pid 397
2020-03-25 11:13:10,033 INFO success: mlmmjadmin entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:10,281 INFO exited: mlmmjadmin (exit status 1; not expected)
2020-03-25 11:13:10,284 INFO spawned: 'mlmmjadmin' with pid 429
2020-03-25 11:13:10,297 INFO success: mlmmjadmin entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:10,413 INFO exited: iredapd (exit status 1; not expected)
2020-03-25 11:13:10,417 INFO spawned: 'iredapd' with pid 440
2020-03-25 11:13:10,424 INFO success: iredapd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:10,432 INFO exited: mlmmjadmin (exit status 1; not expected)
2020-03-25 11:13:10,444 INFO spawned: 'mlmmjadmin' with pid 441
2020-03-25 11:13:10,563 INFO success: mlmmjadmin entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-03-25 11:13:10,607 INFO exited: mlmmjadmin (exit status 1; not expected)
2020-03-25 11:13:10,627 INFO spawned: 'mlmmjadmin' with pid 442
2020-03-25 11:13:10,636 INFO success: mlmmjadmin entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
bash-5.0# cat /var/log/messages 
2020-03-25T11:10:07.796575+00:00 mail : imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
2020-03-25T11:10:07.796587+00:00 mail : activation of module imklog failed [v8.1911.0 try https://www.rsyslog.com/e/2145 ]
2020-03-25T11:10:07.796598+00:00 mail : [origin software="rsyslogd" swVersion="8.1911.0" x-pid="456" x-info="https://www.rsyslog.com"] start
2020-03-25T11:10:07.970658+00:00 mail /supervisord: rsyslog rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
2020-03-25T11:10:07.970795+00:00 mail /supervisord: rsyslog rsyslogd: activation of module imklog failed [v8.1911.0 try https://www.rsyslog.com/e/2145 ]
2020-03-25T11:10:08.067040+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:08.067572+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:08.067987+00:00 mail /supervisord: mlmmjadmin     
2020-03-25T11:10:08.076173+00:00 mail /supervisord: mlmmjadmin import web
2020-03-25T11:10:08.076760+00:00 mail /supervisord: mlmmjadmin ImportError
2020-03-25T11:10:08.078239+00:00 mail /supervisord: mlmmjadmin : No module named web
2020-03-25T11:10:08.165036+00:00 mail /supervisord: mariadb 2020-03-25 11:10:08 0 [Note] /usr/bin/mysqld (mysqld 10.4.12-MariaDB-log) starting as process 458 ...
2020-03-25T11:10:08.173541+00:00 mail /supervisord: mariadb 
2020-03-25T11:10:08.339786+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:08.365514+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:08.366063+00:00 mail /supervisord: mlmmjadmin     
2020-03-25T11:10:08.366366+00:00 mail /supervisord: mlmmjadmin import web
2020-03-25T11:10:08.366699+00:00 mail /supervisord: mlmmjadmin ImportError
2020-03-25T11:10:08.367545+00:00 mail /supervisord: mlmmjadmin : 
2020-03-25T11:10:08.367889+00:00 mail /supervisord: mlmmjadmin No module named web
2020-03-25T11:10:08.368196+00:00 mail /supervisord: mlmmjadmin 
2020-03-25T11:10:08.771189+00:00 mail /supervisord: iredapd Traceback (most recent call last):
2020-03-25T11:10:08.780530+00:00 mail /supervisord: iredapd   File "/opt/iredapd/iredapd.py", line 20, in <module>
2020-03-25T11:10:08.797397+00:00 mail /supervisord: iredapd     from libs import __version__, daemon, utils
2020-03-25T11:10:08.797521+00:00 mail /supervisord: iredapd   File "/opt/iRedAPD-3.5/libs/utils.py", line 16, in <module>
2020-03-25T11:10:08.797551+00:00 mail /supervisord: iredapd     from sqlalchemy import create_engine
2020-03-25T11:10:08.797577+00:00 mail /supervisord: iredapd ImportError: No module named sqlalchemy
2020-03-25T11:10:08.944022+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:08.966118+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:08.973513+00:00 mail /supervisord: mlmmjadmin     import web
2020-03-25T11:10:08.973660+00:00 mail /supervisord: mlmmjadmin ImportError: No module named web
2020-03-25T11:10:09.403499+00:00 mail /supervisord: iredapd Traceback (most recent call last):
2020-03-25T11:10:09.420524+00:00 mail /supervisord: iredapd   File "/opt/iredapd/iredapd.py", line 20, in <module>
2020-03-25T11:10:09.420644+00:00 mail /supervisord: iredapd     from libs import __version__, daemon, utils
2020-03-25T11:10:09.420674+00:00 mail /supervisord: iredapd   File "/opt/iRedAPD-3.5/libs/utils.py", line 16, in <module>
2020-03-25T11:10:09.420701+00:00 mail /supervisord: iredapd     from sqlalchemy import create_engine
2020-03-25T11:10:09.420727+00:00 mail /supervisord: iredapd ImportError: No module named sqlalchemy
2020-03-25T11:10:09.559252+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:09.562582+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:09.583424+00:00 mail /supervisord: mlmmjadmin     import web
2020-03-25T11:10:09.583560+00:00 mail /supervisord: mlmmjadmin ImportError: No module named web
2020-03-25T11:10:09.733560+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:09.736312+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:09.736780+00:00 mail /supervisord: mlmmjadmin     
2020-03-25T11:10:09.737129+00:00 mail /supervisord: mlmmjadmin import web
2020-03-25T11:10:09.737485+00:00 mail /supervisord: mlmmjadmin ImportError
2020-03-25T11:10:09.737821+00:00 mail /supervisord: mlmmjadmin : 
2020-03-25T11:10:09.738153+00:00 mail /supervisord: mlmmjadmin No module named web
2020-03-25T11:10:09.740279+00:00 mail /supervisord: mlmmjadmin 
2020-03-25T11:10:09.763653+00:00 mail /supervisord: fail2ban 2020-03-25 11:10:09,751 fail2ban                [471]: ERROR   Failed during configuration: Have not found any log file for postfix-pregreet jail
2020-03-25T11:10:09.871773+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:09.882981+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:09.883086+00:00 mail /supervisord: mlmmjadmin     import web
2020-03-25T11:10:09.883123+00:00 mail /supervisord: mlmmjadmin ImportError: No module named web
2020-03-25T11:10:10.018520+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:10.020171+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:10.020586+00:00 mail /supervisord: mlmmjadmin     
2020-03-25T11:10:10.020933+00:00 mail /supervisord: mlmmjadmin import web
2020-03-25T11:10:10.021289+00:00 mail /supervisord: mlmmjadmin ImportError
2020-03-25T11:10:10.024183+00:00 mail /supervisord: mlmmjadmin : No module named web
2020-03-25T11:10:10.077123+00:00 mail /supervisord: iredapd Traceback (most recent call last):
2020-03-25T11:10:10.084349+00:00 mail /supervisord: iredapd   File "/opt/iredapd/iredapd.py", line 20, in <module>
2020-03-25T11:10:10.084865+00:00 mail /supervisord: iredapd     
2020-03-25T11:10:10.085267+00:00 mail /supervisord: iredapd from libs import __version__, daemon, utils
2020-03-25T11:10:10.085646+00:00 mail /supervisord: iredapd   File "/opt/iRedAPD-3.5/libs/utils.py", line 16, in <module>
2020-03-25T11:10:10.086044+00:00 mail /supervisord: iredapd     
2020-03-25T11:10:10.086412+00:00 mail /supervisord: iredapd from sqlalchemy import create_engine
2020-03-25T11:10:10.088274+00:00 mail /supervisord: iredapd ImportError: No module named sqlalchemy
2020-03-25T11:10:10.157961+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:10.161639+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:10.168479+00:00 mail /supervisord: mlmmjadmin     import web
2020-03-25T11:10:10.168582+00:00 mail /supervisord: mlmmjadmin ImportError: No module named web
2020-03-25T11:10:10.427535+00:00 mail /supervisord: iredapd Traceback (most recent call last):
2020-03-25T11:10:10.448539+00:00 mail /supervisord: iredapd   File "/opt/iredapd/iredapd.py", line 20, in <module>
2020-03-25T11:10:10.450090+00:00 mail /supervisord: iredapd     
2020-03-25T11:10:10.450432+00:00 mail /supervisord: iredapd from libs import __version__, daemon, utils
2020-03-25T11:10:10.452251+00:00 mail /supervisord: iredapd   File "/opt/iRedAPD-3.5/libs/utils.py", line 16, in <module>
2020-03-25T11:10:10.452307+00:00 mail /supervisord: iredapd     from sqlalchemy import create_engine
2020-03-25T11:10:10.452335+00:00 mail /supervisord: iredapd ImportError: No module named sqlalchemy
2020-03-25T11:10:10.520699+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:10.524289+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:10.529087+00:00 mail /supervisord: mlmmjadmin     import web
2020-03-25T11:10:10.538827+00:00 mail /supervisord: mlmmjadmin ImportError: No module named web
2020-03-25T11:10:10.813306+00:00 mail /supervisord: iredapd Traceback (most recent call last):
2020-03-25T11:10:10.832523+00:00 mail /supervisord: iredapd   File "/opt/iredapd/iredapd.py", line 20, in <module>
2020-03-25T11:10:10.832633+00:00 mail /supervisord: iredapd     from libs import __version__, daemon, utils
2020-03-25T11:10:10.836140+00:00 mail /supervisord: iredapd   File "/opt/iRedAPD-3.5/libs/utils.py", line 16, in <module>
2020-03-25T11:10:10.836261+00:00 mail /supervisord: iredapd     from sqlalchemy import create_engine
2020-03-25T11:10:10.836541+00:00 mail /supervisord: iredapd ImportError: No module named sqlalchemy
2020-03-25T11:10:10.907573+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:10.911567+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
2020-03-25T11:10:10.919540+00:00 mail /supervisord: mlmmjadmin     import web
2020-03-25T11:10:10.920125+00:00 mail /supervisord: mlmmjadmin ImportError: No module named web
2020-03-25T11:10:11.022892+00:00 mail /supervisord: mlmmjadmin Traceback (most recent call last):
2020-03-25T11:10:11.028350+00:00 mail /supervisord: mlmmjadmin   File "/opt/mlmmjadmin/mlmmjadmin.py", line 8, in <module>
iredmail commented 4 years ago

Sad. :(

I'm one of the web.py (it's a micro and awesome Python web framework) maintainers, there's an issue with pypi and the latest release 0.50 is now unavailable, i have to release and publish 0.51 instead.

Will fix this soon.

iredmail commented 4 years ago

hi @TitanFighter

Please git clone and build new image.

Check the commit message of last commit: https://github.com/iredmail/dockerized/commit/a71af6ba53a5b351fb5d3540452d036c786b47ca

There're some changes you need to pay attention:

TitanFighter commented 4 years ago

@iredmail I will check it, thanks.

I have a question regarding touch /etc/iredmail-docker.conf and mkdir /opt/iredmail. What is the purpose of this? This is an anti-pattern. iredmail-docker.conf and folder for iremail components should live anywhere where user wants and as a result user must attach it to run ... manually providing real path for file and folder. Or is it temporary?

EDIT Tested. Result: No errors in terminal on start + Roundcube let me in :) Sending and notification about Delivery status notification work. Receiving does not work (need to reconfigure DNS, but I will try to do it either tomorrow or after tomorrow).

EDIT 2 It would be sweet if you can change current approach for touch /etc/iredmail-docker.conf and mkdir /opt/iredmail in the next few days as I describe above and push it to docker hub (even for private use temporary). In this case a) it could be labeled probably as a "beta" and b) I can test it in a real semi-prod environment together with Lets encrypt.

iredmail commented 4 years ago

I have a question regarding touch /etc/iredmail-docker.conf and mkdir /opt/iredmail. What is the purpose of this? This is an anti-pattern. iredmail-docker.conf and folder for iremail components should live anywhere where user wants and as a result user must attach it to run ... manually providing real path for file and folder. Or is it temporary?

I reopen this issue for further discussion. Or, feel free to create a new issue.

iredmail commented 4 years ago

Technically, you can use any other env file instead of /etc/iredmail-docker.conf with --env-file /path/to/another/iredmail-docker.conf argument while running docker.

iredmail commented 4 years ago

For all-in-one container, i suppose this is ok. but what about setup with docker-compose or K8S (split components to different pods)?

iredmail commented 4 years ago

I can test it in a real semi-prod environment together with Lets encrypt.

It's not recommended to try it in semi-prod or prod server now, something may be changed before final stable release.

Image published on Docker Hub: https://hub.docker.com/r/iredmail/mariadb

TitanFighter commented 4 years ago

The purpose of /opt/iredmail/ and /etc/iredmail-docker.conf is to have a consistent setup for all docker users. When some sysadmin has an issue, instead of telling him/her to check file iredmail-docker.conf somewhere on his/her server (you know, different users store it in different folders), we can tell him/her to check file /etc/iredmail-docker.conf directly. And for sysadmins, he/she just needs to remember one path. This will reduce much work for troubleshooting.

Let me try to re-explain with real example how users/admins use Docker. On my laptop (dev environment) I have the next structure of folders:

~/www/
  project1.com/
    frontend/
      Dockerfiles/
        Dockerfile
        docker-compose.yml
    backend/
      Dockerfiles/
        Dockerfile
        docker-compose.yml
    iredmail/
      Dockerfiles/
        Dockerfile
        docker-compose.yml
      mounted_volumes/
  project2.com/
      /src/
         Dockerfiles/
           Dockerfile
           docker-compose.yml
         project_script_1.py
         project_script_2.py
         project_script_X.py
      iredmail/  #  <--- Everything in one place
         Dockerfiles/
            Dockerfile
            docker-compose-dev.yml
            docker-compose-prod.yml
            iredmail-docker-dev.conf  # <--- Different configs within project's folder
            iredmail-docker-prod.conf  # <--- Different configs within project's folder
         mounted_volumes/

On servers (prod environment) I have the next structure:

/var/www/
  project1.com/
     ....
  project2.com/
     ....

So, as you can see in both cases each project has its own folder where I can find everything related to these projects, including Docker Files (Dockerfile, different versions of docker-compose.yml, different configs) and Docker Volumes, so in this case everything in one place and in case if I need, I can simply scp just one folder (with configs and mounted_volumes) for example from one server to another and everything will work in a minutes without extra actions. This is an advantage of Docker and it is anti-pattern to store anything outside projects folder (exception is possible, but only if it is really necessary). So I propose to remove info about /etc/iredmail-docker.conf and leave just --env-file /path/to/another/iredmail-docker.conf example. This is not your issue as a developer, where config and volumes should live, this is an issue of users/admins - this is how Docker supposed to work.


/opt/iredmail/ should be configurable in /etc/iredmail-docker.conf with a variable, i will try to improve it later. But again, same purpose of above one, for easier troubleshooting and consistent. It's ok to link other directory to /opt/iredmail/.

/opt/iredmail/ should be configurable in /etc/iredmail-docker.conf -> are you talking about DOCKER_VOLUME_BASEDIR, if yes, than users can configure paths like:

DOCKER_VOLUME_BASEDIR=/var/www/project2.com/iredmail/mounted_volumes
DOCKER_VOLUME_CUSTOM_CONF_DIR=/var/www/project2.com/iredmail/mounted_volumes/custom
DOCKER_VOLUME_SSL_DIR=/var/www/project2.com/iredmail/mounted_volumes/ssl
...

and this absolutely ok -> everything can be kept in one folder (/var/www/project2.com/iredmail/mounted_volumes/xyz) otherwise user has flexibility to mount everything as he/she needs.


It's not recommended to try it in semi-prod or prod server now, something may be changed before final stable release.

I will be able to replace old version by new versions easily.


Image published on Docker Hub: https://hub.docker.com/r/iredmail/mariadb

Thanks


For all-in-one container, i suppose this is ok. but what about setup with docker-compose or K8S (split components to different pods)?

In order to share volumes between containers and at the same time to mount volumes to host (to make them as a persistent volumes), one of possible solution can be this one and a simple example. Additionally in case of docker-compose, user's docker-compose.yml replaces iredmail-docker.conf.

P.S. Found typo reuired

iredmail commented 4 years ago

Thanks for sharing.

iredmail commented 4 years ago

Updated README.md again, should be clearer now. Issue closed since all issues mentioned here have been solved. :)

TitanFighter commented 4 years ago

Thanks. Much cooler :)

Just one tip: docker pull iredmail/mariadb:nightly is not required, so can be removed in README. When you docker run ... iredmail/mariadb:nightly it will automatically download the image (if has not been downloaded previously).

iredmail commented 4 years ago

Good catch. Updated. :)