-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-dev.yml
137 lines (129 loc) · 3.38 KB
/
docker-compose-dev.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
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
version: '3'
services:
# db:
# image: mysql:8.0
# container_name: MVStudio-MySQL
# restart: always
# volumes:
# - db_data:/var/lib/mysql
# environment:
# MYSQL_ROOT_PASSWORD: xlaeldlqslek
# MYSQL_DATABASE: mvstudio
# MYSQL_USER: mvstudio_user
# MYSQL_PASSWORD: user_password
# ports:
# - "3300:3306"
# networks:
# - mvs
redis:
image: redis:6
ports:
- '6379:6379'
networks:
- mvs
rabbitmq:
image: rabbitmq:3-management
ports:
- '5672:5672'
- '15672:15672'
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
healthcheck:
test: ['CMD', 'rabbitmqctl', 'status']
interval: 30s
timeout: 10s
retries: 5
networks:
- mvs
celery:
build:
context: ./MVStudio-Backend
ports:
- '5555:5555'
depends_on:
- rabbitmq
- redis
networks:
- mvs
command: >
sh -c "
celery -A config worker --loglevel=info --concurrency=2 -Q default -n worker_1_@%h &
celery -A config worker --loglevel=info --concurrency=2 -Q music_queue -n worker_2_@%h &
celery -A config worker --loglevel=info --concurrency=10 -Q video_queue -n worker_3_@%h &
celery -A config worker --loglevel=info --concurrency=2 -Q final_queue -n worker_4_@%h &
celery -A config flower --port=5555 --broker=$CELERY_BROKER_URL --broker-api=http://guest:guest@rabbitmq:15672/api/"
environment:
- CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/
celery-beat:
build:
context: ./MVStudio-Backend
command: celery -A config beat --loglevel=info
depends_on:
- redis
- rabbitmq
networks:
- mvs
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms256m -Xmx256m
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- es_data:/usr/share/elasticsearch/data
ports:
- '9200:9200'
user: '1000:1000' # 비루트 사용자로 설정
command: >
sh -c "elasticsearch-plugin install analysis-nori &&
bin/elasticsearch"
healthcheck:
test:
[
'CMD-SHELL',
'curl -s http://localhost:9200/_cluster/health | grep -vq ''"status":"red"''',
]
interval: 10s
timeout: 5s
retries: 10
networks:
- mvs
backend:
container_name: MVStudio-Backend
build:
context: ./MVStudio-Backend
volumes:
- ./MVStudio-Backend:/MVStudio-Backend
ports:
- '8000:8000'
depends_on:
redis:
condition: service_started
rabbitmq:
condition: service_started
elasticsearch:
condition: service_healthy
networks:
- mvs
restart: always
command: >
sh -c "
python manage.py makemigrations &&
python manage.py makemigrations member &&
python manage.py makemigrations music_videos &&
python manage.py migrate &&
if [ '$$INIT_INDEX' = 'false' ]; then
python manage.py search_index --create &&
export INIT_INDEX=true
fi &&
python manage.py search_index --rebuild -f&&
python manage.py runserver 0.0.0.0:8000"
volumes:
build_folder:
es_data:
networks:
mvs: