-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
67 lines (61 loc) · 1.52 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
version: '3.5'
# To Join any other app setup using another network, change name and set external = true
networks:
default:
name: "kpm-dev"
external: false
secrets:
env_file:
file: ./.env
services:
mongo:
image: mongo:5.0.8
restart: unless-stopped
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"]
healthcheck:
test: test $$(echo "rs.initiate({_id:'rs0',members:[{_id:0,host:\"mongo:27017\"}]}).ok || rs.status().ok" | mongo --port 27017 --quiet) -eq 1
interval: 10s
start_period: 30s
networks:
- default
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "2"
api:
build:
context: .
restart: unless-stopped
image: kpm-api
environment:
- COMPOSE_CONVERT_WINDOWS_PATHS=1
- APP_MODULE=kpm.main:app
- GUNICORN_CMD_ARGS=--forwarded-allow-ips *
- "MONGODB_URL=mongodb://mongo:27017/?replicaSet=rs0"
- MAX_WORKERS=1
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "2"
depends_on:
- mongo
cron:
build:
context: .
restart: unless-stopped
image: kpm-api
environment:
- COMPOSE_CONVERT_WINDOWS_PATHS=1
- APP_MODULE=kpm.cron_app:app
- GUNICORN_CMD_ARGS=--forwarded-allow-ips *
- "MONGODB_URL=mongodb://mongo:27017/?replicaSet=rs0"
- MAX_WORKERS=1
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "2"
depends_on:
- mongo