-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (97 loc) · 2.56 KB
/
Copy pathdocker-compose.yml
File metadata and controls
105 lines (97 loc) · 2.56 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
# Osprey Production-Like Stack
# Usage: docker-compose up -d
#
# This creates a production-representative environment for load testing:
# - PostgreSQL (instead of SQLite)
# - Redis (instead of in-memory cache)
# - NATS (instead of Go channels)
services:
# PostgreSQL - Production database
postgres:
image: postgres:16-alpine
container_name: osprey-postgres
environment:
POSTGRES_USER: osprey
POSTGRES_PASSWORD: osprey_secret
POSTGRES_DB: osprey
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U osprey -d osprey"]
interval: 5s
timeout: 5s
retries: 5
# Redis - Production cache
redis:
image: redis:7-alpine
container_name: osprey-redis
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
# NATS - Production message bus
nats:
image: nats:2.10-alpine
container_name: osprey-nats
ports:
- "4222:4222" # Client connections
- "8222:8222" # HTTP monitoring
command: ["--jetstream", "--store_dir=/data", "-m", "8222"]
volumes:
- nats_data:/data
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8222/healthz"]
interval: 5s
timeout: 5s
retries: 5
# Osprey - The application (Pro tier config)
osprey:
build:
context: .
dockerfile: Dockerfile
container_name: osprey-app
environment:
# Pro tier with production backends
OSPREY_TIER: pro
OSPREY_MODE: detection
OSPREY_DEBUG: "false"
OSPREY_ADMIN_TOKEN: ${OSPREY_ADMIN_TOKEN:-local-admin-token}
# PostgreSQL
OSPREY_DB_DRIVER: postgres
OSPREY_POSTGRES_HOST: postgres
OSPREY_POSTGRES_PORT: 5432
OSPREY_POSTGRES_USER: osprey
OSPREY_POSTGRES_PASSWORD: osprey_secret
OSPREY_POSTGRES_DB: osprey
# Redis
OSPREY_CACHE_TYPE: redis
OSPREY_REDIS_ADDR: redis:6379
# NATS
OSPREY_BUS_TYPE: nats
OSPREY_NATS_URL: nats://nats:4222
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
nats:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://localhost:8080/health >/dev/null"]
interval: 10s
timeout: 5s
retries: 3
volumes:
postgres_data:
redis_data:
nats_data: