-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
94 lines (86 loc) · 2.29 KB
/
docker-compose.test.yml
File metadata and controls
94 lines (86 loc) · 2.29 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
version: '3.8'
services:
# Main CycleTime application for smoke testing
cycletime-smoke:
build:
context: .
dockerfile: Dockerfile
container_name: cycletime-smoke-test
ports:
- "8080:8080"
environment:
# Test environment configuration
# Note: DB_CLOSE_DELAY=-1 removed - not needed for file-based H2 databases
- DATABASE_URL=jdbc:h2:file:/app/data/cycletime;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE
- PORT=8080
- HOST=0.0.0.0
- KTOR_DEVELOPMENT=false
- JAVA_OPTS=-Xmx512m -XX:+UseG1GC -XX:MaxRAMPercentage=75.0
volumes:
# Persistent test database
- cycletime-smoke-data:/app/data
networks:
- cycletime-smoke-network
# Resource limits for smoke testing
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
reservations:
memory: 256M
cpus: '0.5'
# Health check configuration
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
# Restart policy for testing
restart: "no"
# Smoke test runner service
smoke-test-runner:
image: curlimages/curl:8.4.0
container_name: cycletime-smoke-test-runner
depends_on:
cycletime-smoke:
condition: service_healthy
networks:
- cycletime-smoke-network
volumes:
- ./scripts/smoke-test.sh:/smoke-test.sh:ro
command: >
sh -c "
echo 'Starting smoke tests...' &&
chmod +x /smoke-test.sh &&
/smoke-test.sh cycletime-smoke 8080
"
restart: "no"
# WebSocket test service
websocket-test:
image: node:18-alpine
container_name: cycletime-websocket-test
depends_on:
cycletime-smoke:
condition: service_healthy
networks:
- cycletime-smoke-network
volumes:
- ./scripts/websocket-test.js:/websocket-test.js:ro
working_dir: /
command: >
sh -c "
npm install -g ws &&
node /websocket-test.js ws://cycletime-smoke:8080/ws
"
restart: "no"
volumes:
cycletime-smoke-data:
driver: local
networks:
cycletime-smoke-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16