forked from MTG/freesound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
192 lines (177 loc) · 6.06 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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
version: "3.7"
volumes:
pgdata:
m2home:
solrdata:
solr5data:
fswebhome:
services:
# Database server
db:
image: postgres:12.1
volumes:
- pgdata:/var/lib/postgresql/data
- ./freesound-data/db_dev_dump:/freesound-data/db_dev_dump
env_file:
- environment
ports:
- "${FS_BIND_HOST:-127.0.0.1}:${LOCAL_PORT_PREFIX}5432:5432"
environment:
- POSTGRES_USER=freesound
- POSTGRES_DB=freesound
- FS_USER_ID
# Web worker
web:
build:
context: ./
dockerfile: ./docker/Dockerfile.workers_web
init: true
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
- ./freesound-data/:/freesound-data
- fswebhome:/home/fsweb
ports:
- "0.0.0.0:${LOCAL_PORT_PREFIX}8000:8000" # web does not use FS_BIND_HOST because it should be always 0.0.0.0
- "${FS_BIND_HOST:-127.0.0.1}:${LOCAL_PORT_PREFIX}3000:3000" # needed for debugpy debugger (to connect with vscode)
env_file:
- environment
environment:
- FS_USER_ID
depends_on:
- db
- rabbitmq
- redis
# Search server
search:
build:
context: ./docker/search
dockerfile: Dockerfile.search
init: true
command: mvn -Dsolr.solr.home=/code/solr.home jetty:run-war
volumes:
- solrdata:/var/lib/solr
- m2home:/root/.m2
- ./utils/search/solr4.5.1/solr.home:/code/solr.home
ports:
- "${FS_BIND_HOST:-127.0.0.1}:${LOCAL_PORT_PREFIX}8080:8080"
environment:
- FS_USER_ID
# Search server
solr5:
image: solr:5.5.5
volumes:
- solr5data:/opt/solr/server/solr/mycores
- ./utils/search/solr5.5.5/cores:/cores
- ./utils/search/solr5.5.5/docker-entrypoint:/docker-entrypoint-initdb.d
ports:
- 8983:8983
# Redis (caches)
redis:
image: redis:alpine
command: redis-server --port 6379
# Celery broker (queue manager)
rabbitmq:
hostname: rabbit
image: rabbitmq:3.9.1-management
ports:
- "${FS_BIND_HOST:-127.0.0.1}:${LOCAL_PORT_PREFIX}5673:5673"
volumes:
- ./docker/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
- ./freesound-data/rabbitmq:/var/lib/rabbitmq/mnesia/
# Worker for async tasks and sound processing
worker_celery:
build:
context: ./
dockerfile: ./docker/Dockerfile.workers_web
init: true
command: celery -A freesound worker --concurrency=2 -l info -Q async_tasks_queue,sound_processing_queue,sound_analysis_old_queue
volumes:
- .:/code
- ./freesound-data/:/freesound-data
env_file:
- environment
environment:
- FS_USER_ID
depends_on:
- db
- rabbitmq
# Audio Commons extractor - needs image to be built from freesound-audio-analyzers repository
worker_analyzer1:
profiles: ["analyzers", "all"]
image: ac-extractor_v3
volumes:
- ./freesound-data/:/freesound-data
init: true
command: celery -A main worker --concurrency=1 -l info -Q ac-extractor_v3
depends_on:
- rabbitmq
# Essentia extractor - needs image to be built from freesound-audio-analyzers repository
worker_analyzer2:
profiles: ["analyzers", "all"]
image: fs-essentia-extractor_legacy
volumes:
- ./freesound-data/:/freesound-data
init: true
command: celery -A main worker --concurrency=1 -l info -Q fs-essentia-extractor_legacy
depends_on:
- rabbitmq
# Audioset-YAMNet extractor - needs image to be built from freesound-audio-analyzers repository
# Note this worker must be run with --pool=threads in order for tensorflow predictions to work inside celery
worker_analyzer3:
profiles: ["analyzers", "all"]
image: audioset-yamnet_v1
volumes:
- ./freesound-data/:/freesound-data
init: true
command: celery -A main worker --pool=threads --concurrency=1 -l info -Q audioset-yamnet_v1
depends_on:
- rabbitmq
# Clustering worker (not using the previous one as this has some specific requirements)
worker_clustering:
profiles: ["all"]
build:
context: ./
dockerfile: ./docker/Dockerfile.clustering
init: true
command: celery -A freesound worker -l info -Q clustering
volumes:
- .:/code
- ./freesound-data/clustering_index:/freesound-data/clustering_index
depends_on:
- rabbitmq
- redis
environment:
- ENV_CELERY_WORKER=1
- FS_USER_ID
# Similarity http server
similarity:
profiles: ["all"]
build:
context: ./similarity
dockerfile: ../docker/Dockerfile.similarity
init: true
command: python similarity_server.py
volumes:
- ./similarity:/code
- ./freesound-data/similarity_index:/freesound-data/similarity_index
- ./freesound-data/analysis:/freesound-data/analysis
ports:
- "${FS_BIND_HOST:-127.0.0.1}:${LOCAL_PORT_PREFIX}8008:8008"
environment:
- FS_USER_ID
# Tag recommendation http server
tagrecommendation:
profiles: ["all"]
build:
context: ./tagrecommendation
dockerfile: ../docker/Dockerfile.tagrecommendation
init: true
command: python tagrecommendation_server.py
volumes:
- ./tagrecommendation:/code
- ./freesound-data/tag_recommendation_models:/freesound-data/tag_recommendation_models
ports:
- "${FS_BIND_HOST:-127.0.0.1}:${LOCAL_PORT_PREFIX}8010:8010"
environment:
- FS_USER_ID