-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.simple-test.yml
More file actions
94 lines (82 loc) · 2.27 KB
/
docker-compose.simple-test.yml
File metadata and controls
94 lines (82 loc) · 2.27 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"
# 간단한 C++ 엔진 성능 테스트용 구성
# FastAPI + Redis + PostgreSQL (최소 설정)
services:
# PostgreSQL (테스트용)
postgres:
image: postgres:15-alpine
container_name: kindmap-postgres-test
environment:
POSTGRES_DB: kindmap_test
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
ports:
- "5432:5432"
volumes:
# 실제 DB 덤프가 있다면 여기에 마운트
# - ./db_dump.sql:/docker-entrypoint-initdb.d/init.sql
- postgres-test-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test_user -d kindmap_test"]
interval: 5s
timeout: 3s
retries: 5
# Redis
redis:
image: redis:7-alpine
container_name: kindmap-redis-test
ports:
- "6379:6379"
command: redis-server --appendonly no --maxmemory 256mb
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 3
# FastAPI (C++ 엔진)
fastapi:
image: kindmap-fastapi:latest
container_name: kindmap-fastapi-test
ports:
- "8001:8001"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
# C++ 엔진 활성화 ⭐
USE_CPP_ENGINE: "true"
# PostgreSQL 설정
DB_HOST: "postgres"
DB_PORT: "5432"
DB_NAME: "kindmap_test"
DB_USER: "test_user"
DB_PASSWORD: "test_password"
# Redis 설정
REDIS_HOST: "redis"
REDIS_PORT: "6379"
REDIS_PUBSUB_ENABLED: "false" # WebSocket 비활성화
# 성능 모니터링
ENABLE_PERFORMANCE_MONITORING: "true"
SLOW_REQUEST_THRESHOLD_MS: "500"
# 기타
DEBUG: "false"
ALLOWED_ORIGINS: "http://localhost:8089,http://127.0.0.1:8089"
command: >
uvicorn app.main:app
--host 0.0.0.0
--port 8001
--workers 1
--log-level info
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/health').read()"]
interval: 10s
timeout: 5s
retries: 5
start_period: 40s
networks:
default:
name: kindmap-test-network
volumes:
postgres-test-data: