-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
71 lines (66 loc) · 2.54 KB
/
Copy pathdocker-compose.test.yml
File metadata and controls
71 lines (66 loc) · 2.54 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
# ================================================================
# docker-compose.test.yml — Docker 기반 pytest 통합 테스트 오버라이드
#
# 사용법:
# docker compose -f docker-compose.yml -f docker-compose.test.yml \
# run --rm --build test-runner
# ================================================================
version: '3.8'
services:
# 테스트 전용 postgres 및 redis (base에서 확장)
postgres:
environment:
POSTGRES_DB: alpha_test_db
POSTGRES_USER: alpha_user
POSTGRES_PASSWORD: alpha_pass
volumes:
- test_postgres_data:/var/lib/postgresql/data
redis:
volumes:
- test_redis_data:/data
# ────────────────────────────────────────────────────────────────
# 테스트 러너 서비스
# ────────────────────────────────────────────────────────────────
test-runner:
build:
context: .
dockerfile: Dockerfile
environment:
NODE_ENV: test
# 데이터베이스 연결
DATABASE_URL: postgresql://alpha_user:alpha_pass@postgres:5432/alpha_test_db
REDIS_URL: redis://redis:6379/0
# 페이퍼 트레이딩 모드 (필수)
KIS_IS_PAPER_TRADING: "true"
# S3/MinIO (테스트에서 사용하지 않음 - 더미값)
S3_ENDPOINT_URL: http://minio-test:9000
S3_ACCESS_KEY: test_minio
S3_SECRET_KEY: test_minio_secret
S3_BUCKET_NAME: alpha-test-lake
S3_REGION: ap-northeast-2
# LLM API 키 (테스트에서 skip되거나 모킹됨)
ANTHROPIC_API_KEY: sk-test-000000000000000000000000
OPENAI_API_KEY: sk-test-000000000000000000000000
GOOGLE_API_KEY: test-key-000000000000000000
# GEMINI_API_KEY 제거됨 — OAuth(ADC) 전용
# KIS 브로커 (테스트 모드)
KIS_API_KEY: test-kis-key
KIS_SECRET_KEY: test-kis-secret
KIS_APP_CODE: test-app-code
# 알림 (테스트에서 무시)
TELEGRAM_BOT_TOKEN: test-bot-token
TELEGRAM_CHAT_ID: test-chat-id
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./:/app
# 명령: DB 초기화 → pytest 실행
command: bash -c "python scripts/db/init_db.py && pytest test/ -v --tb=short -x"
stdin_open: true
tty: true
volumes:
test_postgres_data:
test_redis_data: