-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
88 lines (84 loc) · 2.24 KB
/
docker-compose.test.yml
File metadata and controls
88 lines (84 loc) · 2.24 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
services:
postgres-test:
build:
context: ./docker/
dockerfile: ./postgres/Dockerfile
args:
PGROONGA_VERSION: 4.0.1-1
POSTGRESQL_VERSION: 17
container_name: baander-postgres-test
restart: unless-stopped
networks:
- baander-test-network
ports:
- "127.0.0.1:5433:5432" # Different port to avoid conflicts
shm_size: 128mb
environment:
POSTGRES_DB: baander_test
POSTGRES_USER: baander_test
POSTGRES_PASSWORD: test_password
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
volumes:
- postgres_test_data:/var/lib/postgresql/data
- ./docker/test/postgres-init:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U baander_test -d baander_test"]
interval: 5s
timeout: 5s
retries: 5
redis-test:
image: redis/redis-stack-server:edge
container_name: baander-redis-test
restart: unless-stopped
networks:
- baander-test-network
ports:
- "127.0.0.1:6380:6379" # Different port to avoid conflicts
volumes:
- redis_test_data:/data
- ./docker/test/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# Optional: Test runner container
app-test:
build:
context: .
dockerfile: Dockerfile
#target: development
container_name: baander-app-test
networks:
- baander-test-network
volumes:
- .:/var/www/html
environment:
- APP_ENV=testing
- DB_CONNECTION=pgsql
- DB_HOST=postgres-test
- DB_PORT=5432
- DB_DATABASE=baander_test
- DB_USERNAME=baander_test
- DB_PASSWORD=test_password
- REDIS_HOST=redis-test
- REDIS_PORT=6379
- CACHE_DRIVER=redis
- SESSION_DRIVER=redis
- QUEUE_CONNECTION=redis
depends_on:
postgres-test:
condition: service_healthy
redis-test:
condition: service_healthy
profiles:
- test-runner
networks:
baander-test-network:
driver: bridge
volumes:
postgres_test_data:
driver: local
redis_test_data:
driver: local