-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
127 lines (127 loc) · 2.97 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
version: "3.8"
services:
db:
container_name: db
image: "postgres:alpine"
environment:
- POSTGRES_DB=${DOCKER_POSTGRES_DB}
- POSTGRES_USER=${DOCKER_POSTGRES_USER}
- POSTGRES_PASSWORD=${DOCKER_POSTGRES_PASSWORD}
- PGDATA=${DOCKER_PGDATA}
deploy:
resources:
limits:
cpus: "0.50"
memory: 200M
reservations:
memory: 100M
networks:
- webappnetwork
volumes:
- covid19dbvolume:/var/lib/postgresql/data # using named volume to persist data; run `docker volume create covid19dbvolume` before `docker-compose up`
command: ["postgres", "-c", "log_statement=all"] # To see all the commands running on our db live
ports:
- "5432:5432"
redis:
container_name: redis
image: "redis:alpine"
deploy:
resources:
limits:
cpus: "0.20"
memory: 200M
reservations:
memory: 100M
networks:
- webappnetwork
backend:
container_name: backend
restart: always
deploy:
resources:
limits:
cpus: "0.20"
memory: 500M
reservations:
memory: 100M
build:
context: .
target: backend-base
command: uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port 8000
environment:
- TORTOISEORM_DSN=${DOCKER_DSN}
ports:
- "8000:8000"
volumes:
- ./backend_service/app:/usr/src/app/app
networks:
- webappnetwork
depends_on:
- db
celery:
container_name: celery
restart: always
deploy:
resources:
limits:
cpus: "0.20"
memory: 500M
reservations:
memory: 100M
build:
context: .
target: polling-base
command: celery -A api_poller worker -l info
volumes:
- ./polling_service/api_poller/:/usr/src/app/api_poller/
environment:
- TORTOISEORM_DSN=${DOCKER_DSN}
- POLLING_MINUTES=${DOCKER_POLLING_MINUTES}
- POLLED_URL=${DOCKER_POLLED_URL}
networks:
- webappnetwork
depends_on:
- redis
celery-beat:
container_name: celery-beat
restart: always
deploy:
resources:
limits:
cpus: "0.20"
memory: 500M
reservations:
memory: 100M
build:
context: .
target: polling-base
command: celery -A api_poller beat -l info
volumes:
- ./polling_service/api_poller/:/usr/src/app/api_poller/
environment:
- TORTOISEORM_DSN=${DOCKER_DSN}
- POLLING_MINUTES=${DOCKER_POLLING_MINUTES}
- POLLED_URL=${DOCKER_POLLED_URL}
networks:
- webappnetwork
depends_on:
- redis
ngrok:
container_name: ngrok
image: wernight/ngrok:latest
ports:
- 4040:4040
environment:
NGROK_PROTOCOL: http
NGROK_PORT: backend:8000
networks:
- webappnetwork
depends_on:
- backend
- db
networks:
webappnetwork:
driver: bridge
volumes:
covid19dbvolume:
external: true