-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
73 lines (68 loc) · 1.64 KB
/
docker-compose.yml
File metadata and controls
73 lines (68 loc) · 1.64 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
# Docker Compose for Avian API Server Development
version: "3.8"
services:
# API Server
api:
build: .
ports:
- "3002:3002"
environment:
- API_DEBUG=true
- API_LOG_LEVEL=DEBUG
- REDIS_URL=redis://redis:6379/0
- API_RPC_HOST=${API_RPC_HOST:-host.docker.internal}
- API_RPC_PORT=${API_RPC_PORT:-8767}
- API_RPC_USER=${API_RPC_USER:-your-rpc-username}
- API_RPC_PASSWORD=${API_RPC_PASSWORD:-your-rpc-password}
- API_SECRET_KEY=dev-secret-change-in-production
depends_on:
- redis
volumes:
- .:/app
- /app/__pycache__ # Exclude pycache
networks:
- api-network
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3002/info"]
interval: 30s
timeout: 10s
retries: 3
# Redis for caching and Socket.IO
redis:
image: redis:7-alpine
ports:
- "6380:6379" # Use port 6380 externally to avoid conflict
volumes:
- redis_data:/data
networks:
- api-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# Optional: Nginx reverse proxy for production
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro # SSL certificates
depends_on:
- api
networks:
- api-network
restart: unless-stopped
profiles:
- production
volumes:
redis_data:
networks:
api-network:
driver: bridge