-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
88 lines (73 loc) · 1.83 KB
/
docker-compose.yml
File metadata and controls
88 lines (73 loc) · 1.83 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
version: '3.8'
services:
openlucky:
build: .
container_name: openlucky-bot
restart: unless-stopped
# Environment variables
environment:
- PYTHONUNBUFFERED=1
- TZ=UTC
# Volume mounts
volumes:
- ./config.ini:/app/config.ini:ro # Read-only config
- ./data:/app/data # Data persistence
- ./logs:/app/logs # Log persistence
# Network configuration
networks:
- openlucky-network
# Resource limits
deploy:
resources:
limits:
memory: 1G
cpus: '0.5'
reservations:
memory: 512M
cpus: '0.25'
# Health check
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('https://www.okx.com/api/v5/public/time', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Optional: Data sync service (can run separately)
openlucky-sync:
build: .
container_name: openlucky-sync
restart: unless-stopped
command: ["python", "okx_sync.py"]
environment:
- PYTHONUNBUFFERED=1
- TZ=UTC
volumes:
- ./config.ini:/app/config.ini:ro
- ./data:/app/data
- ./logs:/app/logs
networks:
- openlucky-network
deploy:
resources:
limits:
memory: 512M
cpus: '0.3'
healthcheck:
test: ["CMD", "python", "-c", "import os; exit(0 if os.path.exists('/app/data/summary.json') else 1)"]
interval: 60s
timeout: 10s
retries: 3
networks:
openlucky-network:
driver: bridge
volumes:
openlucky-data:
driver: local
openlucky-logs:
driver: local