-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
155 lines (137 loc) · 3.85 KB
/
docker-compose.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Run 'docker-compose up' to create all the services
version: '3.5'
# Create a network named "emailnet-660046669" with IP range 192.168.1.0/24
networks:
emailnet-660046669:
name: emailnet-660046669
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.1.0/24
services:
# Start the Bluebook with static IP 192.168.1.3
bluebook:
build: BlueBook/.
image: 660046669/bluebook:latest
ports:
- "3008:8888"
networks:
emailnet-660046669:
ipv4_address: 192.168.1.3
restart: on-failure
container_name: BlueBook
# All the MSAs and MTAs have a "depends_on" to the Bluebook, not because the
# containers actually need the Bluebook to run, but rather because we need the
# Bluebook to have a specific static IP (192.168.1.3), so we use depends_on
# to force all the other containers to wait until Bluebook has started to
# fetch another random IP in the range 192.168.1.0/24
# Start the MSAs in any order, they will get an IP assigned to them
msa-billgates:
build: MSA/.
image: 660046669/msa:latest
container_name: MSA-billgates.at.here.com
ports:
- "3000:8888"
command: "[email protected]"
networks:
- emailnet-660046669
depends_on:
- bluebook
restart: on-failure
msa-alanturing:
build: MSA/.
image: 660046669/msa:latest
container_name: MSA-alanturing.at.here.com
ports:
- "3001:8888"
command: "[email protected]"
networks:
- emailnet-660046669
depends_on:
- bluebook
restart: on-failure
msa-stevejobs:
build: MSA/.
image: 660046669/msa:latest
container_name: MSA-stevejobs.at.there.com
ports:
- "3002:8888"
command: "[email protected]"
networks:
- emailnet-660046669
depends_on:
- bluebook
restart: on-failure
msa-adalovelace:
build: MSA/.
image: 660046669/msa:latest
container_name: MSA-adalovelace.at.there.com
ports:
- "3003:8888"
command: "[email protected]"
networks:
- emailnet-660046669
depends_on:
- bluebook
restart: on-failure
msa-gracehopper:
build: MSA/.
image: 660046669/msa:latest
container_name: MSA-gracehopper.at.other.org
ports:
- "3004:8888"
command: "[email protected]"
networks:
- emailnet-660046669
depends_on:
- bluebook
restart: on-failure
# Start the MTAs in any order, they will get an IP assigned to them
mta-here:
build: MTA/.
image: 660046669/mta:latest
container_name: MTA-here.com
ports:
- "3005:8888"
command: "here.com"
networks:
- emailnet-660046669
depends_on:
- bluebook
restart: on-failure
mta-there:
build: MTA/.
image: 660046669/mta:latest
container_name: MTA-there.com
ports:
- "3006:8888"
command: "there.com"
networks:
- emailnet-660046669
depends_on:
- bluebook
restart: on-failure
mta-other:
build: MTA/.
image: 660046669/mta:latest
container_name: MTA-other.org
ports:
- "3007:8888"
command: "other.org"
networks:
- emailnet-660046669
depends_on:
- bluebook
restart: on-failure
# Here are some examples...
# Sending an email:
# curl -v --request POST 'http://localhost:3002/email' -d '{ "from": "[email protected]", "to": "[email protected]", "subject": "Successes and failures", "body": "Hey, remember Windows Phone? Me neither." }'
# Reading the inbox:
# curl -v --request GET 'http://localhost:3000/email'
# Read one message in the inbox:
# curl -v --request GET 'http://localhost:3000/email{uuid}
# Find the UUID by first listing all messages in the inbox, and replace it in the URL
# Delete a message in the inbox:
# curl -v --request DELETE 'http://localhost:3000/email {uuid}
# Find the UUID by first listing all messages in the inbox, and replace it in the URL