-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (80 loc) · 2.49 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (80 loc) · 2.49 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
volumes:
ircd_certs:
iroffer_files:
iroffer_config:
networks:
ircnet:
driver: bridge
services:
ircd:
image: inspircd/inspircd-docker:latest
container_name: dccbot-test-ircd
ports:
- "6667:6667"
- "6697:6697"
environment:
- INSP_NET_NAME=TestIRC
- INSP_ADMIN_NAME=Test Admin
- INSP_ADMIN_EMAIL=test@localhost
- INSP_ADMIN_NICK=TestAdmin
- INSP_SERVER_NAME=test.local
- INSP_SERVER_DESCRIPTION=Test IRC Server for dccbot
- INSP_ENABLE_SSL=yes
- INSP_SSL_CERT_PATH=/inspircd/certs/cert.pem
- INSP_SSL_KEY_PATH=/inspircd/certs/key.pem
volumes:
- ircd_certs:/inspircd/certs
- ./tests/integration/inspircd_config:/inspircd/conf.d:ro
entrypoint: /inspircd/conf.d/inspircd_entrypoint.sh
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 6667 || exit 1"]
interval: 5s
timeout: 3s
retries: 10
start_period: 15s
networks:
- ircnet
xdccbot:
build:
context: .
dockerfile: tests/integration/iroffer.Dockerfile
container_name: dccbot-test-xdcc
hostname: xdccbot
depends_on:
ircd:
condition: service_healthy
ports:
- "10000-10010:10000-10010"
volumes:
- iroffer_files:/files
- iroffer_config:/config
networks:
- ircnet
healthcheck:
test: ["CMD-SHELL", "test -f /config/iroffer.log && grep -q 'Added: \\[Pack 1\\]' /config/iroffer.log"]
interval: 3s
timeout: 3s
retries: 40
start_period: 10s
command: >
sh -c "
echo 'Cleaning up old files and state...' &&
rm -f /files/test1.txt /files/test2.txt /config/iroffer.state /config/iroffer.log &&
echo 'Generating test files...' &&
mkdir -p /files &&
# Create a 512KB test file (takes ~4 seconds at 100KB/s)
dd if=/dev/urandom bs=1024 count=512 of=/files/test1.bin 2>/dev/null &&
# Create a smaller 64KB backup test file
dd if=/dev/urandom bs=1024 count=64 of=/files/test2.bin 2>/dev/null &&
echo 'Test files generated:' &&
ls -la /files/ &&
echo 'Refreshing iroffer config...' &&
cp /config-template/mybot.config /config/mybot.config &&
echo 'Waiting for IRC server to be ready...' &&
sleep 5 &&
echo 'Starting iroffer (daemon mode for non-TTY container)...' &&
cd /config &&
iroffer -b mybot.config &&
echo 'iroffer started, tailing logs...' &&
exec tail -F /config/iroffer.log
"