-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathdocker-compose-dev.yml
More file actions
146 lines (142 loc) · 4.68 KB
/
Copy pathdocker-compose-dev.yml
File metadata and controls
146 lines (142 loc) · 4.68 KB
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
services:
aps:
image: r4ulcl/wifichallengelab-aps:dev
restart: on-failure # Automatically restart on failure
container_name: WiFiChallengeLab-APs
env_file:
- ./wlan_config
volumes:
- ./certs:/root/certs/:ro
- ./certs:/root/mgt/certs/:ro
- ./certs:/var/www/html/.internalCA/
- /lib/modules:/lib/modules
- /usr/src:/usr/src
- /usr/lib:/host_usr_lib:ro
- ./logsAP:/root/logs/
healthcheck:
test:
- CMD-SHELL
- |
ip netns exec ns-ap /bin/bash -c '
curl -f -s -o /dev/null http://localhost/login.php || exit 1;
curl -s -o /dev/null http://localhost:8080 || exit 2;
pgrep -x freeradius >/dev/null || exit 3;
[ "$(pgrep -xc host_aps_apd)" -ge 18 ] || exit 4;
phy_count="$$(iw dev | grep -c "^phy#")";
wlan_count="$$(iw dev | grep -c "^[[:space:]]*Interface wlan[0-9][0-9]*$")";
echo "AP radio assignment: $${phy_count}/34 PHY devices, $${wlan_count}/34 WLAN interfaces (wlan6-wlan39)";
[ "$${phy_count}" -eq 34 ] || exit 5;
[ "$${wlan_count}" -eq 34 ] || exit 6'
interval: 15s
timeout: 10s
retries: 5
start_period: 45s
start_interval: 3s
network_mode: host #NETNS
privileged: true #NETNS
clients:
image: r4ulcl/wifichallengelab-clients:dev
restart: on-failure # Automatically restart on failure
container_name: WiFiChallengeLab-Clients
env_file:
- ./wlan_config
volumes:
- ./certs:/root/certs/:ro
- /lib/modules:/lib/modules
- ./logsClient:/root/logs/
depends_on:
- aps
network_mode: host #NETNS
privileged: true #NETNS
healthcheck:
test:
- CMD-SHELL
- |
ip netns exec ns-client /bin/bash -c '
curl -s -o /dev/null http://localhost || exit 1;
[ "$(pgrep -c wpa_wifichallen)" -ge 17 ] || exit 2;
phy_count="$$(iw dev | grep -c "^phy#")";
wlan_count="$$(iw dev | grep -c "^[[:space:]]*Interface wlan[0-9][0-9]*$")";
echo "Clients radio assignment: $${phy_count}/30 PHY devices, $${wlan_count}/30 WLAN interfaces (wlan40-wlan69)";
[ "$${phy_count}" -eq 30 ] || exit 3;
[ "$${wlan_count}" -eq 30 ] || exit 4'
interval: 15s
timeout: 10s
retries: 5
start_period: 45s
start_interval: 3s
nzyme:
image: r4ulcl/wifichallengelab-nzyme:latest
restart: on-failure # Automatically restart on failure
env_file:
- ./nzyme/.env
- ./wlan_config
#env_file: .env
container_name: WiFiChallengeLab-nzyme
security_opt:
- no-new-privileges:true
volumes:
- ./nzyme/nzyme-logs/logs/:/var/log/nzyme/
- ./nzyme/nzyme.conf.tmp:/etc/nzyme/nzyme.conf.tmp
#ports:
# - "22900:22900"
depends_on:
- aps
- db
environment:
- TZ=Europe/Berlin
# Keep the JVM boxed inside the container so it can't thrash the whole VM:
# bounded heap+metaspace, single-threaded GC, and one worker CPU (host net
# otherwise makes the JVM size its thread pools to every host core), plus
# hard-exit on OOM so it restarts cleanly instead of GC death-spiralling.
- JAVA_TOOL_OPTIONS=-Xms64m -Xmx256m -XX:MaxMetaspaceSize=128m -XX:+UseSerialGC -XX:ActiveProcessorCount=1 -XX:+ExitOnOutOfMemoryError
network_mode: host #USB Antena
healthcheck:
test: ["CMD-SHELL", "curl -f -s -o /dev/null http://localhost:22900 || exit 1"]
interval: 15s
timeout: 10s
retries: 5
start_period: 60s
start_interval: 3s
cap_add: # full access to wifi interface
- NET_ADMIN
- NET_RAW
cpu_shares: 256 # lower priority than APs/clients when the VM is busy
deploy:
resources:
limits:
cpus: "0.50"
memory: 512M
pids: 200
reservations:
memory: 128M
db:
image: postgres:14
restart: unless-stopped
#env_file: ./nzyme/.env
env_file: .env
container_name: WiFiChallengeLab-nzyme-db
security_opt:
- no-new-privileges:true
depends_on:
- aps
environment:
- TZ=Europe/Berlin
volumes:
- ./nzyme/nzyme-logs/data:/var/lib/postgresql/data
ports:
- 127.0.0.1:5432:5432 # Since we use host net on nzyme, listen only locally
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-nzyme} -d $${POSTGRES_DB:-nzyme}"]
interval: 15s
timeout: 5s
retries: 5
start_period: 15s
start_interval: 3s
deploy:
resources:
limits:
cpus: "0.50"
memory: 512M
reservations:
memory: 128M