-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
111 lines (99 loc) · 2.38 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
# Exit code 137: OOM, Increase docker memory: Docker Desktop app > Preferences > Resources > Advanced and increase the MEMORY
# docker-compose up --build
version: "3.9"
services:
db:
image: postgres
restart: always
environment:
POSTGRES_USER: username
POSTGRES_PASSWORD: postgres
POSTGRES_DB: eventdb
ports:
- 5433:5432
volumes:
- .:/code
web:
build: .
command: >
sh -c "python manage.py collectstatic --noinput &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
- "${DOCKER_MEDIA_VOLUME:-.}:/data"
ports:
- 8000:8000
environment:
POSTGRES_NAME: eventdb
POSTGRES_USER: username
POSTGRES_PASSWORD: postgres
depends_on:
- db
- redis
# Run ipython notebooks for data analysis
# notebook:
# build: .
# command: >
# sh -c "cd notebooks &&
# ../manage.py shell_plus --notebook"
# volumes:
# - .:/code
# ports:
# - 8888:8888
# environment:
# POSTGRES_NAME: eventdb
# POSTGRES_USER: username
# POSTGRES_PASSWORD: postgres
# depends_on:
# - db
# - redis
# Redis for worker messaging
redis:
image: "redis:alpine"
# Admin interface for db inspection (alternative to Django http://127.0.0.1:8000/admin/)
adminer:
image: adminer
restart: always
ports:
- 8080:8080
# Celery async worker objects:
worker_object:
build: .
command: celery -A homesite worker -l info -n object_worker -Q save_object_q
volumes:
- .:/code
environment:
- C_FORCE_ROOT=true
depends_on:
- redis
worker_stream:
build: .
command: celery -A homesite worker -l info -n stream_worker -Q stream_q
volumes:
- .:/code
environment:
- C_FORCE_ROOT=true
depends_on:
- redis
worker_media:
build: .
command: celery -A homesite worker -l info -n media_worker -Q save_media_q
volumes:
- .:/code
environment:
- C_FORCE_ROOT=true
depends_on:
- redis
# Celery periodic tasks:
# beat:
# build: .
# command: celery -A homesite beat -l info -S django
# volumes:
# - .:/code
# environment:
# - POSTGRES_NAME: eventdb
# - POSTGRES_USER: username
# - POSTGRES_PASSWORD: postgres
# depends_on:
# - redis