Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Docker Compose Version and Some SQL Always update, permission problem mitigated. #135

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# Run all applications in one container.
FROM ubuntu:jammy
MAINTAINER Zhang Huangbin <[email protected]>
EXPOSE 80 443 25 465 587 143 993 110 995 4190
#ldap/ldaps
EXPOSE 389 636 25 465 587 143 993 7791 20000 19999

ARG ENTRYPOINTS_DIR=/docker/entrypoints
ARG SCRIPTS_DIR=/docker/scripts
Expand Down Expand Up @@ -41,7 +42,9 @@ COPY ./config/. /
# entrypoint scripts
#
COPY ./entrypoints/. ${ENTRYPOINTS_DIR}/
COPY ./settings.conf ${ENTRYPOINTS_DIR}/
#####################SETTING UNIFICATION######################
COPY ./iredmail-docker.conf ${ENTRYPOINTS_DIR}/
##############################################################

# Main entrypoint script.
COPY ./entrypoints/all_in_one.sh /entrypoint.sh
Expand Down
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,59 @@ docker run \
iredmail/mariadb:stable
```


# Use Docker-Compose
Docker Compose build file provided to `docker-compose.yml`.

This docker compose file use volume bind, insted of docker volume, Unlike the docker run example above.

The reason is to access the `.data/ directory` path in a file format to __restore, recover, and expand the volume bind__ to high availability in __docker-compose, Kubernetes__.

Notes:

- carefully config `docker-compose.yml` file, especially docker __Bind Volume Path__.
- __Do not modify__ `.data/ directory`, and __Access__, or __Remove__.
- Must __backup__ your `.data/ directory`.

Compose build with logs:
```
docker-compose build
```

Compose build with no cache:
```
docker-compose build --no-cache
```

And Compose Start with logs:
```
# Compose up with logs. (Ctrl + C, or exit means contaier stop.)
docker-compose up

# Compose up with no logs. (Deattached, Even containers run backround.)
docker-compose up -d
```

Use to `docker-compose logs` or `docker-compose exec`.
```
# Compose display logs.
docker-compose logs

# Compose attach bash with input output tty. (attach, Even containers run and, it use to EXEC(unix process method) bash process.)
docker-compose exec -it iredmail bash
```

Finalley, You possible debug, or Supervisor Status check in the IRedmain Container.
```
# View raw log.
ls -alh /var/log/

# Supervisor damon display sub process status.
supervisorctl status
```



# Overview

Only one config file `iredmail-docker.conf` on Docker host.
Expand Down
2 changes: 1 addition & 1 deletion config/etc/clamav/clamd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DatabaseDirectory /var/lib/clamav
OfficialDatabaseOnly false

# Socket
LocalSocket /run/clamav/clamd.ctl
LocalSocket /tmp/clamd.socket
FixStaleSocket true
LocalSocketGroup clamav
LocalSocketMode 666
Expand Down
1 change: 1 addition & 0 deletions config/etc/memcached.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-l 127.0.0.1
2 changes: 1 addition & 1 deletion config/etc/mysql/my.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ default-character-set = utf8mb4
[mysqld]
port = 3306
bind-address = 0.0.0.0
user = mysql
user = root
datadir = /var/lib/mysql
pid-file = /var/lib/mysql/mysql.pid

Expand Down
3 changes: 2 additions & 1 deletion config/etc/nginx/sites-available/00-default-ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ server {
include /opt/iredmail/custom/nginx/sites-conf.d/default-ssl/*.conf;
include /etc/nginx/sites-conf.d/default-ssl/*.conf;

include /etc/nginx/templates/roundcube-homepage.tmpl;
include /etc/nginx/templates/roundcube-homepage.tmpl;
root /opt/www/roundcubemail;

include /etc/nginx/templates/sogo.tmpl;
}
70 changes: 70 additions & 0 deletions config/etc/nginx/templates/sogo.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Settings for SOGo Groupware

# SOGo
location ~ ^/sogo { rewrite ^ https://$host/SOGo; }
location ~ ^/SOGO { rewrite ^ https://$host/SOGo; }

# Redirect /mail to /SOGo
#location ~ ^/mail { rewrite ^ https://$host/SOGo; }

# For Mac OS X and iOS devices.
rewrite ^/.well-known/caldav /SOGo/dav permanent;
rewrite ^/.well-known/carddav /SOGo/dav permanent;
rewrite ^/principals /SOGo/dav permanent;

location ^~ /SOGo {
include /etc/nginx/templates/hsts.tmpl;

proxy_pass http://127.0.0.1:20000;


# reslove SOGo5 login problems
proxy_buffers 4 256k;
proxy_buffer_size 128k;

# forward user's IP address
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;

# always use https
proxy_set_header x-webobjects-server-port $server_port;
proxy_set_header x-webobjects-server-name $host;
proxy_set_header x-webobjects-server-url https://$host;

proxy_set_header x-webobjects-server-protocol HTTP/1.0;
}

location ^~ /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;

proxy_connect_timeout 3540;
proxy_send_timeout 3540;
proxy_read_timeout 3540;
}

location ^~ /SOGo/Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;

proxy_connect_timeout 3540;
proxy_send_timeout 3540;
proxy_read_timeout 3540;
}

location /SOGo.woa/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
expires max;
}
location /SOGo/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
expires max;
}
location ^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$ {
alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
expires max;
}
location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$) {
alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
expires max;
}

2 changes: 1 addition & 1 deletion config/etc/php/8.1/fpm/pool.d/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ listen.group = www-data
listen.mode = 0660

; IP addresses must be separated by comma, and no space between comma and ip.
listen.allowed_clients = 127.0.0.1
;listen.allowed_clients = 0.0.0.0

pm = dynamic
pm.max_children = 200
Expand Down
Loading