-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
152 lines (137 loc) · 3.55 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
152 lines (137 loc) · 3.55 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
140
141
142
143
144
145
146
147
148
149
150
151
152
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:15-alpine
container_name: savevideobot_db_dev
environment:
POSTGRES_DB: botdb
POSTGRES_USER: user
POSTGRES_PASSWORD: password
volumes:
- postgres_data_dev:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- savevideobot_network
# Redis Cache
redis:
image: redis:7-alpine
container_name: savevideobot_redis_dev
command: redis-server --appendonly yes
volumes:
- redis_data_dev:/data
ports:
- "6379:6379"
networks:
- savevideobot_network
# SaveVideoBot Application (Development)
app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: savevideobot_app_dev
environment:
# Bot Configuration
BOT_TOKEN: ${BOT_TOKEN}
ADMIN_ID: ${ADMIN_ID}
BOT_MODE: polling
# Database Configuration
POSTGRES_URL: postgresql://user:password@db:5432/botdb
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: botdb
# Redis Configuration
REDIS_URL: redis://redis:6379/0
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_DB: 0
# Server Configuration
HOST: 0.0.0.0
PORT: 8000
DEBUG: true
# yt-dlp Configuration
YT_DLP_OPTS: --no-warnings -f best
MAX_FILE_SIZE: 500000000
DOWNLOAD_TIMEOUT: 300
# Rate Limiting
RATE_LIMIT_REQUESTS: 10
RATE_LIMIT_WINDOW: 60
# File Management
TEMP_DIR: /tmp/savevideobot
FILE_CLEANUP_INTERVAL: 900
# Monitoring
ENABLE_METRICS: true
METRICS_PORT: 9090
# Logging
LOG_LEVEL: DEBUG
LOG_FORMAT: text
ports:
- "8000:8000"
- "9090:9090"
volumes:
- .:/app
- temp_files_dev:/tmp/savevideobot
depends_on:
- db
- redis
networks:
- savevideobot_network
restart: unless-stopped
# Celery Worker (Development)
celery_worker:
build:
context: .
dockerfile: Dockerfile.dev
container_name: savevideobot_celery_worker_dev
command: celery -A app.celery_app worker --loglevel=debug --queues=downloads,cleanup
environment:
# Same environment as app service
BOT_TOKEN: ${BOT_TOKEN}
ADMIN_ID: ${ADMIN_ID}
POSTGRES_URL: postgresql://user:password@db:5432/botdb
REDIS_URL: redis://redis:6379/0
YT_DLP_OPTS: --no-warnings -f best
MAX_FILE_SIZE: 500000000
DOWNLOAD_TIMEOUT: 300
TEMP_DIR: /tmp/savevideobot
FILE_CLEANUP_INTERVAL: 900
LOG_LEVEL: DEBUG
LOG_FORMAT: text
volumes:
- .:/app
- temp_files_dev:/tmp/savevideobot
depends_on:
- db
- redis
networks:
- savevideobot_network
restart: unless-stopped
# Flower - Celery Monitoring
flower:
build:
context: .
dockerfile: Dockerfile.dev
container_name: savevideobot_flower_dev
command: celery -A app.celery_app flower --port=5555
environment:
REDIS_URL: redis://redis:6379/0
ports:
- "5555:5555"
depends_on:
- redis
networks:
- savevideobot_network
restart: unless-stopped
volumes:
postgres_data_dev:
driver: local
redis_data_dev:
driver: local
temp_files_dev:
driver: local
networks:
savevideobot_network:
driver: bridge