-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
139 lines (133 loc) · 4.62 KB
/
Copy pathdocker-compose.test.yml
File metadata and controls
139 lines (133 loc) · 4.62 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Test infrastructure for integration tests.
# Start with: docker compose -f docker-compose.test.yml up -d
# Stop with: docker compose -f docker-compose.test.yml down -v
#
# Exposes:
# PostgreSQL → localhost:5433
# RabbitMQ → localhost:5672 (AMQP) / localhost:15672 (management)
# MinIO → localhost:9000 / localhost:9001 (console)
# Orchestrator → localhost:8082/health
# Backend API → localhost:8000
#
# AI workers (stt-service, nmt-service) are intentionally excluded so that
# integration tests can fake AI workers in-process, keeping tests fast.
# Add them manually when running the full E2E shell scripts instead.
services:
# ─── PostgreSQL ──────────────────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: dabljaar_test_postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: dabljaar
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d dabljaar"]
interval: 5s
timeout: 5s
retries: 10
networks:
- dabljaar_test_network
# ─── RabbitMQ ────────────────────────────────────────────────────────────────
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: dabljaar_test_rabbitmq
volumes:
- ./infra/rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 5s
timeout: 5s
retries: 10
networks:
- dabljaar_test_network
# ─── MinIO ───────────────────────────────────────────────────────────────────
minio:
image: minio/minio:latest
container_name: dabljaar_test_minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
networks:
- dabljaar_test_network
# ─── Go Orchestrator ─────────────────────────────────────────────────────────
orchestrator:
build:
context: ./orchestrator
dockerfile: Dockerfile
container_name: dabljaar_test_orchestrator
environment:
RABBITMQ_URL: "amqp://guest:guest@rabbitmq:5672/"
DATABASE_URL: "postgres://postgres:postgres@postgres:5432/dabljaar?sslmode=disable"
HEALTH_PORT: "8082"
ports:
- "8082:8082"
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
restart: on-failure
networks:
- dabljaar_test_network
# ─── Backend API (runs Alembic migrations + serves API) ──────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
args:
INSTALL_AI: "false"
container_name: dabljaar_test_backend
environment:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/dabljaar
SECRET_KEY: test-secret-key
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 60
REFRESH_TOKEN_EXPIRE_DAYS: 7
RABBITMQ_URL: "amqp://guest:guest@rabbitmq:5672/"
MINIO_ENDPOINT: minio:9000
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
MINIO_BUCKET_NAME: dablaja-videos
MINIO_SECURE: "false"
S3_ENDPOINT_URL: http://minio:9000
S3_MEDIA_BUCKET: dablaja-videos
S3_MODELS_BUCKET: model
STORAGE_BACKEND: s3
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
minio:
condition: service_started
restart: on-failure
networks:
- dabljaar_test_network
command: >
sh -c "
alembic upgrade head &&
uvicorn app.main:app --host 0.0.0.0 --port 8000
"
networks:
dabljaar_test_network:
driver: bridge