-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
46 lines (42 loc) · 993 Bytes
/
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
version: '3.1'
services:
database:
image: postgres:11-alpine
environment:
POSTGRES_PASSWORD: secret
volumes:
- ./postgres:/var/lib/postgresql/data
redis:
image: redis:5.0-alpine
web:
build: .
environment:
SERVER_NAME: localhost:8000
SECRET_KEY: qwerty
DATABASE_URL: postgres://postgres:secret@database:5432/postgres
REDIS_URL: redis://redis:6379/0
command: >
sh -c "python manage.py db upgrade
&& python manage.py serve -h 0.0.0.0"
volumes:
- .:/app
depends_on:
- database
- redis
ports:
- 8000:8000
worker:
build: .
environment:
SERVER_NAME: localhost:8000
SECRET_KEY: qwerty
DATABASE_URL: postgres://postgres:secret@database:5432/postgres
REDIS_URL: redis://redis:6379/0
command: >
sh -c "python manage.py db upgrade
&& python manage.py tasks"
volumes:
- .:/app
depends_on:
- database
- redis