-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
87 lines (81 loc) · 1.71 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
version: "3"
services:
app:
build:
context: .
dockerfile: config/app/Dockerfile
command: "python -m lib.server"
# command: "python recommender.py" # for debug
# command: "python -m lib.db" # for initialization of database
restart: always
volumes:
- .:/app
environment:
- PG_USER=pg
- PG_PW=pg
- PG_DB=app
- PG_HOST=postgres
- PG_PORT=5432
ports:
- "8050:8050"
links:
- postgres
- celery_worker
redis:
image: redis
ports:
- "6379"
celery_worker:
build:
context: .
dockerfile: config/app/Dockerfile
command: "celery -A lib.tasks worker --loglevel=info"
volumes:
- .:/app
links:
- redis
test_celery_tasks:
build:
context: .
dockerfile: config/app/Dockerfile
command: "python -m tests.test_celery_tasks"
volumes:
- .:/app
postgres:
image: postgres:11.3
environment:
- POSTGRES_USER=pg
- POSTGRES_PASSWORD=pg
- POSTGRES_DB=app
- PGDATA=/data/postgres
ports:
- "5432"
restart: unless-stopped
volumes:
- ./data/postgres:/data/postgres
test_app:
build:
context: .
dockerfile: config/app/Dockerfile
command: "sh -c 'python -m lib.db && pytest tests'"
# command: "python -m lib.db"
volumes:
- .:/app
environment:
- PG_USER=pg
- PG_PW=pg
- PG_HOST=test_postgres
- PG_PORT=5432
- PG_DB=test_app
links:
- test_postgres
- celery_worker
test_postgres:
image: postgres:11.3
environment:
- POSTGRES_USER=pg
- POSTGRES_PASSWORD=pg
- POSTGRES_DB=test_app
ports:
- "5432"
restart: "no"