-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
67 lines (64 loc) · 1.9 KB
/
docker-compose.test.yml
File metadata and controls
67 lines (64 loc) · 1.9 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
# docker-compose.test.yml - Test environment for E2E tests
# Usage: docker compose -f docker-compose.test.yml up -d
# go test -tags=e2e -v ./tests/e2e/...
# docker compose -f docker-compose.test.yml down -v
services:
postgres-test:
image: postgres:16-alpine
environment:
POSTGRES_USER: usulnet_test
POSTGRES_PASSWORD: test_password_e2e
POSTGRES_DB: usulnet_test
ports:
- "15432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U usulnet_test"]
interval: 2s
timeout: 5s
retries: 10
tmpfs:
- /var/lib/postgresql/data
redis-test:
image: redis:8-alpine
entrypoint:
- /bin/sh
- -c
- |
set -e
command -v openssl >/dev/null 2>&1 || apk add --no-cache openssl >/dev/null 2>&1
mkdir -p /tmp/redis-certs
openssl req -new -x509 -days 3650 -nodes \
-newkey ec -pkeyopt ec_paramgen_curve:P-256 \
-subj "/CN=redis-test/O=usulnet" \
-keyout /tmp/redis-certs/server.key \
-out /tmp/redis-certs/server.crt 2>/dev/null
chmod 600 /tmp/redis-certs/server.key
chmod 644 /tmp/redis-certs/server.crt
exec redis-server \
--tls-port 6379 \
--port 0 \
--tls-cert-file /tmp/redis-certs/server.crt \
--tls-key-file /tmp/redis-certs/server.key \
--tls-auth-clients no
ports:
- "16379:6379"
healthcheck:
test: ["CMD", "redis-cli", "--tls", "--insecure", "ping"]
interval: 2s
timeout: 5s
retries: 10
tmpfs:
- /data
nats-test:
image: nats:2.12-alpine
command: ["--jetstream", "--store_dir=/data", "--http_port=8222"]
ports:
- "14222:4222"
- "18222:8222"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8222/healthz"]
interval: 2s
timeout: 5s
retries: 10
tmpfs:
- /data