Browse Source

Updated docker-compose.yml

tags/v2.0.0
Robin Thoni 5 years ago
parent
commit
039002f807
1 changed files with 29 additions and 42 deletions
  1. 29
    42
      docker-compose.yml

+ 29
- 42
docker-compose.yml View File

1
-version: '2'
1
+version: '3.7'
2
+
3
+x-common: &common
4
+#  restart: unless-stopped
5
+  env_file:
6
+    - env
2
 
7
 
3
 services:
8
 services:
4
-    database:
9
+    postgresql:
10
+        <<: *common
5
         build: ./postgresql
11
         build: ./postgresql
6
-        container_name: mx-postgresql
7
-#        restart: unless-stopped
8
         networks:
12
         networks:
9
-            mx.internal.docker:
13
+            main:
10
                 aliases:
14
                 aliases:
11
-                    - postgresql.mx.internal.docker
15
+                    - postgresql.main.internal.docker
12
         volumes:
16
         volumes:
13
             - ./data/postgresql/data:/var/lib/postgresql/data
17
             - ./data/postgresql/data:/var/lib/postgresql/data
14
-            - ./data/postgresql/backup:/var/lib/postgresql/backup
15
         ports:
18
         ports:
16
             - "127.0.0.1:34000:5432"
19
             - "127.0.0.1:34000:5432"
17
-        env_file:
18
-            - env
19
 
20
 
20
     postfixadmin:
21
     postfixadmin:
22
+        <<: *common
21
         build: ./postfixadmin
23
         build: ./postfixadmin
22
-        container_name: mx-postfixadmin
23
-#        restart: unless-stopped
24
         networks:
24
         networks:
25
-            mx.internal.docker:
25
+            main:
26
                 aliases:
26
                 aliases:
27
-                    - postfixadmin.mx.internal.docker
27
+                    - postfixadmin.main.internal.docker
28
         ports:
28
         ports:
29
             - "127.0.0.1:34001:80"
29
             - "127.0.0.1:34001:80"
30
-        env_file:
31
-            - env
32
 
30
 
33
     postfix:
31
     postfix:
32
+        <<: *common
34
         build: ./postfix
33
         build: ./postfix
35
-        container_name: mx-postfix
36
-#        restart: unless-stopped
37
         networks:
34
         networks:
38
-            mx.internal.docker:
35
+            main:
39
                 aliases:
36
                 aliases:
40
-                    - postfix.mx.internal.docker
37
+                    - mail1.example.com
38
+        volumes:
39
+            - ./data/common/certs:/etc/ssl/certs
41
         ports:
40
         ports:
42
             - "0.0.0.0:25:25"
41
             - "0.0.0.0:25:25"
43
             - "0.0.0.0:465:465"
42
             - "0.0.0.0:465:465"
44
             - "0.0.0.0:587:587"
43
             - "0.0.0.0:587:587"
45
-        env_file:
46
-            - env
47
 
44
 
48
     dovecot:
45
     dovecot:
46
+        <<: *common
49
         build: ./dovecot
47
         build: ./dovecot
50
-        container_name: mx-dovecot
51
-#        restart: unless-stopped
52
         networks:
48
         networks:
53
-            mx.internal.docker:
49
+            main:
54
                 aliases:
50
                 aliases:
55
-                    - dovecot.mx.internal.docker
51
+                    - dovecot.main.internal.docker
56
         volumes:
52
         volumes:
53
+            - ./data/common/certs:/etc/ssl/certs
57
             - ./data/dovecot/email:/var/email
54
             - ./data/dovecot/email:/var/email
58
         ports:
55
         ports:
59
-            - "0.0.0.0:110:110"
60
             - "0.0.0.0:143:143"
56
             - "0.0.0.0:143:143"
61
             - "0.0.0.0:993:993"
57
             - "0.0.0.0:993:993"
62
-            - "0.0.0.0:995:995"
63
             - "0.0.0.0:4190:4190"
58
             - "0.0.0.0:4190:4190"
64
-        env_file:
65
-            - env
66
 
59
 
67
     opendkim:
60
     opendkim:
61
+        <<: *common
68
         build: ./opendkim
62
         build: ./opendkim
69
-        container_name: mx-opendkim
70
-#        restart: unless-stopped
71
         networks:
63
         networks:
72
-            mx.internal.docker:
64
+            main:
73
                 aliases:
65
                 aliases:
74
-                    - opendkim.mx.internal.docker
66
+                    - opendkim.main.internal.docker
75
         volumes:
67
         volumes:
76
             - ./data/opendkim/keys:/etc/opendkim/keys
68
             - ./data/opendkim/keys:/etc/opendkim/keys
77
-        env_file:
78
-            - env
79
 
69
 
80
     milter-sasl:
70
     milter-sasl:
71
+        <<: *common
81
         build: ./milter-sasl
72
         build: ./milter-sasl
82
-        container_name: mx-milter-sasl
83
-#        restart: unless-stopped
84
         networks:
73
         networks:
85
-            mx.internal.docker:
74
+            main:
86
                 aliases:
75
                 aliases:
87
-                  - milter-sasl.mx.internal.docker
88
-        env_file:
89
-            - env
76
+                  - milter-sasl.main.internal.docker
90
 
77
 
91
 networks:
78
 networks:
92
-    mx.internal.docker:
79
+    main:

Loading…
Cancel
Save