-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
63 lines (57 loc) · 1.41 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
version: '3.8'
volumes:
music:
db:
redis_data:
services:
musicservice:
container_name: musicservice
image: thijstakken/musicservice:latest
restart: always
links:
- database
ports:
- 5678:5678
volumes:
- music:/music
depends_on:
- database
- redis
environment:
- REDIS_URL=redis://redis:6379/0
- DATABASE_URL=mysql+pymysql://musicservice:musicservice@database/musicservice
database:
container_name: mysql
image: mysql:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: musicservice
MYSQL_USER: musicservice
MYSQL_PASSWORD: musicservice
volumes:
- db:/var/lib/mysql
# this is the redis server, which is used for the task queue
redis:
image: redis:latest
container_name: redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: always
# this worker runs the tasks for the musicservice, so it can download the music
taskworker:
container_name: taskworker
image: thijstakken/musicservice:latest
command: worker -u redis://redis:6379/0 music-tasks
# use custom entrypoint to run the taskworker
entrypoint: rq
volumes:
- music:/music
depends_on:
- redis
- database
environment:
- DATABASE_URL=mysql+pymysql://musicservice:musicservice@database/musicservice
restart: always