-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
71 lines (65 loc) Β· 1.77 KB
/
docker-compose.test.yml
File metadata and controls
71 lines (65 loc) Β· 1.77 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
version: '3.8'
# Docker Compose for testing memory optimizations
# Limits memory to 512MB (same as Heroku eco dyno) to verify optimizations
services:
# Test service with memory limits
agentship-test:
build:
context: .
dockerfile: Dockerfile
container_name: agentship-test
command: ["uvicorn", "src.service.main:app", "--host", "0.0.0.0", "--port", "7001"]
ports:
- "7001:7001"
env_file:
- .env
environment:
- ENVIRONMENT=test
- LOG_LEVEL=INFO
- AGENT_SESSION_STORE_URI=postgresql://ai_agents_user:ai_agents_password@postgres:5432/ai_agents_session_store
# Memory limit matching Heroku eco dyno (512MB)
mem_limit: 512m
mem_reservation: 256m
# CPU limit
cpus: '0.5'
volumes:
- ./src:/app/src
- ./tests:/app/tests
depends_on:
postgres:
condition: service_healthy
restart: "no"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7001/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
networks:
- agentship-network
# PostgreSQL for testing
postgres:
image: postgres:16-alpine
container_name: agentship-test-postgres
environment:
POSTGRES_DB: ai_agents_session_store
POSTGRES_USER: ai_agents_user
POSTGRES_PASSWORD: ai_agents_password
ports:
- "5433:5432" # Different port to avoid conflicts
volumes:
- postgres_test_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ai_agents_user -d ai_agents_session_store"]
interval: 5s
timeout: 3s
retries: 5
restart: "no"
networks:
- agentship-network
volumes:
postgres_test_data:
driver: local
networks:
agentship-network:
driver: bridge