-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
75 lines (75 loc) · 1.87 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
version: '2'
services:
db:
restart: always
image: postgres:latest
volumes:
- /opt/audio-gallery/pgdata:/var/lib/postgresql/data/
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=postgres
- POSTGRES_DB=audiogallery
expose:
- "5432"
memcached:
restart: always
image: memcached:latest
expose:
- "11211"
rabbit:
restart: always
image: rabbitmq:latest
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=password
expose:
- "5672"
nginx:
restart: always
image: nginx:latest
ports:
- "8888:8000"
volumes: # TODO read-only
- ./config/nginx:/etc/nginx/conf.d
- /opt/audio-gallery/static:/opt/audio-gallery/static
- /opt/audio-gallery/media:/opt/audio-gallery/media
depends_on:
- web
worker:
restart: always
build: .
env_file: .django_env
# only one worker container is needed, because it automatically starts 2*n+1 processes (n - num of CPU cores)
container_name: audiogallery_worker
volumes:
- /opt/audio-gallery/static:/opt/audio-gallery/static
- /opt/audio-gallery/media:/opt/audio-gallery/media
- /opt/audio-gallery/logs:/opt/audio-gallery/logs
- .:/src/audio-gallery/source
depends_on:
- db
- memcached
- rabbit
environment:
- IS_WORKER=true
web:
restart: always
build: .
env_file: .django_env
volumes: # same as worker's
- /opt/audio-gallery/static:/opt/audio-gallery/static
- /opt/audio-gallery/media:/opt/audio-gallery/media
- /opt/audio-gallery/logs:/opt/audio-gallery/logs
- .:/src/audio-gallery/source
expose:
- "8000"
depends_on:
- db
- memcached
- rabbit
- worker
# deploy:
# restart_policy:
# delay: 5s
# max_attempts: 3
# window: 90s