-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-server.docker-compose.yaml
More file actions
128 lines (121 loc) · 2.68 KB
/
api-server.docker-compose.yaml
File metadata and controls
128 lines (121 loc) · 2.68 KB
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
128
version: "3.7"
services:
api-server:
build:
context: .
dockerfile: api-server.dockerfile
ports:
- "127.0.0.1:5001:5000"
depends_on:
- postgres
env_file:
- .env
environment:
DATABASE_URL: dbname=edsearch user=postgres password=password host=postgres port=5432
deploy:
resources:
limits:
cpus: "2.0"
memory: 2048M
develop:
watch:
- action: rebuild
path: ./src
ingest-worker:
build:
context: .
dockerfile: api-server.dockerfile
ports:
- "127.0.0.1:5002:5000"
depends_on:
- postgres
env_file:
- .env
environment:
DATABASE_URL: dbname=edsearch user=postgres password=password host=postgres port=5432
command: ["python3", "-m", "src.Ingest"]
deploy:
resources:
limits:
cpus: "2.0"
memory: 2048M
develop:
watch:
- action: rebuild
path: ./src
ingest-cron:
image: alpine:latest
configs:
- source: CronTab
target: /etc/crontabs/root
command: >
sh -c "
# Install curl so we can execute the request.
apk add --no-cache curl >/dev/null 2>&1 &&
# Run cron in the foreground, at log level 2.
crond -f -l 2
"
restart: unless-stopped
depends_on:
- ingest-worker
deploy:
resources:
limits:
cpus: "2.0"
memory: 2048M
postgres:
build:
context: .
dockerfile: postgres.dockerfile
volumes:
- db-data:/var/lib/postgresql/data
shm_size: 1g
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: edsearch
ports:
- "127.0.0.1:5432:5432"
deploy:
resources:
limits:
cpus: "2.0"
memory: 2048M
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: admin@localhost.lan
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
ports:
- "127.0.0.1:5050:80"
depends_on:
- postgres
configs:
- source: PGAdmin
target: /pgadmin4/servers.json
deploy:
resources:
limits:
cpus: "2.0"
memory: 2048M
configs:
CronTab:
content: |
0 6 * * * curl -X POST http://ingest-worker:5000/ingest/today
PGAdmin:
content: |
{
"Servers": {
"1": {
"Name": "EDSearch",
"Group": "Server Group 1",
"Port": 5432,
"Username": "postgres",
"Host": "postgres",
"SSLMode": "prefer",
"MaintenanceDB": "postgres"
}
}
}
volumes:
db-data: