-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
79 lines (76 loc) · 2.05 KB
/
docker-compose.yml
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
version: "2"
services:
my-redis:
image: redis:7.2.4
container_name: redis
ports:
- "6379:6379"
volumes:
# Mount the custom redis.conf file into the container
- ./redis.conf:/usr/local/etc/redis/redis.conf
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
db:
image: mysql
container_name: mysql-db
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
environment:
- MYSQL_DATABASE=chat-app-db
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
chat-app:
container_name: chat-app
build:
context: .
dockerfile: deployments/${ENVIRON}/Dockerfile
ports:
- "8000:8000"
volumes:
- .:/usr/src/app
depends_on:
- my-redis
- db
environment:
- SECRET_KEY=${SECRET_KEY}
- DB_NAME=chat-app-db
- DB_USER=${MYSQL_USER}
- DB_PASSWORD=${MYSQL_PASSWORD}
- DB_HOST=db
- DB_PORT=3306
- REDIS_PROTOCOL=${REDIS_PROTOCOL}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=my-redis
- REDIS_PORT=6379
- DJANGO_REDIS_CACHE_DB=${DJANGO_REDIS_CACHE_DB}
- REDIS_DB_CHANNEL=${REDIS_DB_CHANNEL}
- REDIS_DB_CELERY=${REDIS_DB_CELERY}
celery:
container_name: celery-worker
build:
context: .
dockerfile: deployments/${ENVIRON}/Dockerfile
depends_on:
- my-redis
- chat-app
volumes:
- .:/usr/src/app
environment:
- SECRET_KEY=${SECRET_KEY}
- DB_NAME=chat-app-db
- DB_USER=${MYSQL_USER}
- DB_PASSWORD=${MYSQL_PASSWORD}
- DB_HOST=db
- DB_PORT=3306
- REDIS_PROTOCOL=${REDIS_PROTOCOL}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=my-redis
- REDIS_PORT=6379
- DJANGO_REDIS_CACHE_DB=${DJANGO_REDIS_CACHE_DB}
- REDIS_DB_CHANNEL=${REDIS_DB_CHANNEL}
- REDIS_DB_CELERY=${REDIS_DB_CELERY}
command: ["celery", "-A", "chat_connect", "worker", "--loglevel=info", "--concurrency=4"]
volumes:
db_data: