forked from iredmail/dockerized
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_all_in_one.sh
executable file
·67 lines (60 loc) · 1.55 KB
/
run_all_in_one.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# Author: Zhang Huangbin <[email protected]>
# Purpose: Run the all-in-one container.
#
# This file is managed by iRedMail Team <[email protected]> with Ansible,
# please do __NOT__ modify it manually.
#
PWD="$(pwd)"
CONF="${PWD}/iredmail-docker.conf"
DATA_DIR="${PWD}/data"
if [[ ! -e ${CONF} ]]; then
echo "ERROR: Config file ${CONF} doesn't exist."
echo "ERROR: Please create it first."
exit 255
fi
. ${CONF}
DATA_SUB_DIRS='
backup-mysql
clamav
custom
imapsieve_copy
mailboxes
mlmmj
mlmmj-archive
mysql
postfix_queue
sa_rules
ssl
'
for i in ${DATA_SUB_DIRS}; do
_dir="${DATA_DIR}/${i}"
if [ ! -d ${_dir} ]; then
echo "+ Create local volume directory: ${_dir}"
mkdir -p ${_dir}
fi
done
docker run \
--rm \
--env-file ${CONF} \
--hostname ${HOSTNAME} \
-p 80:80 \
-p 443:443 \
-p 110:110 \
-p 995:995 \
-p 143:143 \
-p 993:993 \
-p 25:25 \
-p 587:587 \
-v ${DATA_DIR}/custom:/opt/iredmail/custom \
-v ${DATA_DIR}/ssl:/opt/iredmail/ssl \
-v ${DATA_DIR}/backup-mysql:/var/vmail/backup/mysql \
-v ${DATA_DIR}/mailboxes:/var/vmail/vmail1 \
-v ${DATA_DIR}/mysql:/var/lib/mysql \
-v ${DATA_DIR}/clamav:/var/lib/clamav \
-v ${DATA_DIR}/mlmmj:/var/vmail/mlmmj \
-v ${DATA_DIR}/mlmmj-archive:/var/vmail/mlmmj-archive \
-v ${DATA_DIR}/imapsieve_copy:/var/vmail/imapsieve_copy \
-v ${DATA_DIR}/sa_rules:/var/lib/spamassassin \
-v ${DATA_DIR}/postfix_queue:/var/spool/postfix \
iredmail/mariadb:nightly