Browse Source

Updated docker-compose.yml

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

Loading…
Cancel
Save