forked from alexmerser/hackerspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
56 lines (53 loc) · 1.45 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
version: '2' # supported by default install on Ubuntu 18.04
services:
db:
image: postgres:9.5-alpine # Production server is using 9.5.17
expose:
- "5432"
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_HOST_AUTH_METHOD: "trust" # http://support.divio.com/en/articles/3719228-database-is-uninitialized-and-superuser-password-is-not-specified
redis:
image: "redis:5.0-alpine" # Production server is using 3.0.6
ports:
- 6379:6379
web:
#restart: unless-stopped
build: . # current directory
env_file: .env
command: bash -c "python /app/src/manage.py migrate &&
python /app/src/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
- db
- redis
celery:
build: .
env_file: .env
command: bash -c "cd src &&
python manage.py migrate &&
celery -A hackerspace_online worker -l info -c 3 -Q default"
volumes:
- .:/app
depends_on:
- redis
celery-beat:
build: .
env_file: .env
command: bash -c "cd src &&
python manage.py migrate &&
celery -A hackerspace_online beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
volumes:
- .:/app
depends_on:
- db
- redis
volumes:
postgres_data:
redis_data: