-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
130 lines (125 loc) · 3.11 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
##########################################################################
# This file is part of the Docker-Networks' Lab session support files.
# Copyright (C) 2022-2023 Eric Roy <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##########################################################################
# BASIC HELP MENU
#################
# - Requisites: cd in this file's location, run `docker swarm init`.
# - Run `docker-compose up -d` to start.
# - Run `docker-compose down` to stop.
# - Attatch to every node's bash terminal with
# `docker attach docker_networks_node1_1` (or any node).
# - You can exit the node's bash terminal you stop that container.
# Restart that single container with `docker_compose restart node1`
# This file will start multiple containers connected with some educational
# networks. You can check some diagrams and basic documentation at
# https://github.com/royalmo/docker-networks
---
version: "3.5"
services:
node1:
image: royalmo/docker-networks
hostname: node1
tty: true
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- net0
- net1
node2:
image: royalmo/docker-networks
hostname: node2
tty: true
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- net1
- net2
- net3
node3:
image: royalmo/docker-networks
hostname: node3
tty: true
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- net1
node4:
image: royalmo/docker-networks
hostname: node4
tty: true
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- net2
- net4
- net5
node5:
image: royalmo/docker-networks
hostname: node5
tty: true
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- net3
- net4
- net6
node6:
image: royalmo/docker-networks
hostname: node6
tty: true
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- net5
node7:
image: royalmo/docker-networks
hostname: node7
tty: true
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- net6
# If you wish to use bridge networks insead of overlay networks,
# change the driver of each network and remove the "internal" flag.
networks:
net0:
driver: bridge
net1:
driver: overlay
internal: true
net2:
driver: overlay
internal: true
net3:
driver: overlay
internal: true
net4:
driver: overlay
internal: true
net5:
driver: overlay
internal: true
net6:
driver: overlay
internal: true