-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (96 loc) · 2.14 KB
/
docker-compose.yml
File metadata and controls
103 lines (96 loc) · 2.14 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
version: '3.8'
services:
# Redis - Cache, Message Broker, Channel Layer
redis:
image: redis:7-alpine
container_name: modbus_redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
# Django Web Application
web:
build: .
container_name: modbus_web
restart: unless-stopped
command: gunicorn modbus_webserver.asgi:application -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000 --workers 4
volumes:
- .:/app
- static_volume:/app/staticfiles
- media_volume:/app/media
ports:
- "8000:8000"
env_file:
- .env
depends_on:
- redis
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
# Celery Worker
celery_worker:
build: .
container_name: modbus_celery_worker
restart: unless-stopped
command: celery -A modbus_webserver worker -l info --concurrency=4
volumes:
- .:/app
env_file:
- .env
depends_on:
- redis
- web
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
# Celery Beat Scheduler
celery_beat:
build: .
container_name: modbus_celery_beat
restart: unless-stopped
command: celery -A modbus_webserver beat -l info
volumes:
- .:/app
env_file:
- .env
depends_on:
- redis
- web
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
# Celery Flower (optional monitoring)
flower:
build: .
container_name: modbus_flower
restart: unless-stopped
command: celery -A modbus_webserver flower --port=5555
ports:
- "5555:5555"
env_file:
- .env
depends_on:
- redis
- celery_worker
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
# Nginx Reverse Proxy
nginx:
image: nginx:alpine
container_name: modbus_nginx
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- static_volume:/app/staticfiles:ro
- media_volume:/app/media:ro
depends_on:
- web
volumes:
redis_data:
static_volume:
media_volume: