-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose-with-mount.yml
43 lines (43 loc) · 1.12 KB
/
docker-compose-with-mount.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
web:
build: .
ports:
- "8000:8000"
volumes:
- ./channels-example/:/opt/app/channels-example/
links:
- db
- redis
environment:
- DATABASE_URL=postgres://user:openhouse2016@db:5432/chat
- REDIS_URL=redis://redis:6379/1
db:
image: praiskup/postgresql:APIv1.0.1-fedora23
# volumes:
# - ./db:/var/lib/pgsql/data
environment:
- POSTGRESQL_DATABASE=chat
- POSTGRESQL_USER=user
- POSTGRESQL_PASSWORD=openhouse2016
- POSTGRESQL_CONTAINER_OPTS=assert_external_data = false
worker:
build: .
environment:
- DATABASE_URL=postgres://user:openhouse2016@db:5432/chat
- REDIS_URL=redis://redis:6379/1
links:
- db
- redis
volumes:
- ./channels-example/:/opt/app/channels-example/
command: bash -c "sleep 7 && exec python /opt/app/channels-example/manage.py runworker -v3"
redis:
image: redis
migrator:
build: .
environment:
- DATABASE_URL=postgres://user:openhouse2016@db:5432/chat
- REDIS_URL=redis://redis:6379/1
links:
- db
# it indeed takes this long to start the database
command: bash -c "sleep 5 && exec python /opt/app/channels-example/manage.py migrate"