-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathdocker-compose.all-cores.yml
More file actions
81 lines (76 loc) · 2.18 KB
/
docker-compose.all-cores.yml
File metadata and controls
81 lines (76 loc) · 2.18 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
# Docker Compose configuration for local testing of all cachier cores
# This file provides all external services needed for comprehensive testing
version: "3.8"
services:
mongodb:
image: mongo:latest
container_name: cachier-test-mongo
ports:
- "27017:27017"
environment:
MONGO_INITDB_DATABASE: cachier_test
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
networks:
- cachier-test
redis:
image: redis:7-alpine
container_name: cachier-test-redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
start_period: 5s
networks:
- cachier-test
postgres:
image: postgres:15
container_name: cachier-test-postgres
ports:
- "5432:5432"
environment:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
POSTGRES_DB: testdb
healthcheck:
test: ["CMD-SHELL", "pg_isready -U testuser"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
networks:
- cachier-test
networks:
cachier-test:
driver: bridge
# Usage examples:
#
# Start all services:
# docker-compose -f scripts/docker-compose.all-cores.yml up -d
#
# Start specific services:
# docker-compose -f scripts/docker-compose.all-cores.yml up -d mongodb redis
#
# Check service health:
# docker-compose -f scripts/docker-compose.all-cores.yml ps
#
# View logs:
# docker-compose -f scripts/docker-compose.all-cores.yml logs -f
#
# Stop all services:
# docker-compose -f scripts/docker-compose.all-cores.yml down
#
# Run tests with all services:
# docker-compose -f scripts/docker-compose.all-cores.yml up -d
# CACHIER_TEST_HOST=localhost CACHIER_TEST_PORT=27017 CACHIER_TEST_VS_DOCKERIZED_MONGO=true \
# CACHIER_TEST_REDIS_HOST=localhost CACHIER_TEST_REDIS_PORT=6379 CACHIER_TEST_VS_DOCKERIZED_REDIS=true \
# SQLALCHEMY_DATABASE_URL="postgresql://testuser:testpass@localhost:5432/testdb" \
# pytest -m "mongo or redis or sql"
# docker-compose -f scripts/docker-compose.all-cores.yml down