-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
97 lines (90 loc) · 2.5 KB
/
docker-compose.yaml
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
services:
db:
image: postgis/postgis:13-3.1-alpine
restart: on-failure
ports:
- 5432:5432
volumes:
- ./data/db:/var/lib/postgresql/data:rw
env_file:
- ./envs/.db.env
nginx:
image: nginx:latest
build: ./nginx
restart: on-failure
ports:
- 80:80
volumes:
- ./data/packages:/www/data/packages # Prod
# - ./tests/data/packages:/www/data/packages # Testing
redis:
image: ghcr.io/nismod/irv-autopkg-redis:0.1
build: ./redis
restart: always
user: autopkg
ports:
- 6379:6379
command: redis-server --save 20 1 --loglevel debug
volumes:
- ./data/redis:/data
cpus: "0.25"
mem_reservation: "50M"
mem_limit: "250M"
flower:
image: mher/flower
command: celery --broker=redis://redis flower
volumes:
- ./data/flower:/data
working_dir: /data
ports:
- 5555:5555
environment:
CELERY_BROKER_URL: redis://redis
CELERY_RESULT_BACKEND: redis://redis
dataproc:
image: ghcr.io/nismod/irv-autopkg:0.3.1-dev
user: autopkg
build: .
volumes:
- ./data/packages:/data/packages
- ./data/processing:/data/processing
- ./tests:/usr/src/app/tests
env_file:
- envs/.api_and_dataproc.env
command: celery --app dataproc.tasks worker
cpus: 2
mem_reservation: "500M"
mem_limit: "1G"
api:
image: ghcr.io/nismod/irv-autopkg:0.3.1-dev
build: .
volumes:
- ./data/packages:/data/packages
- ./data/processing:/data/processing
- ./tests:/usr/src/app/tests
ports:
- 8000:8000
env_file:
- envs/.api_and_dataproc.env
command: uvicorn api.main:app --host 0.0.0.0 --port 8000
cpus: "0.25"
mem_reservation: "50M"
mem_limit: "250M"
# API test-harness requires API and Dataproc to be running
# WARNING - THESE TESTS WILL WIPE THE CONFIGURED TEST HARNESS DB from anything in MODELS
# To run tests change AUTOPKG_DEPLOYMENT_ENV=test in .api_and_dataproc.env, then reboot api and dataproc services
test-api:
image: ghcr.io/nismod/irv-autopkg:0.3.1-dev
volumes:
- ./tests:/usr/src/app/tests
env_file:
- envs/.api_and_dataproc.env
command: python -m unittest discover /usr/src/app/tests/api
# Dataproc test-harness only requires DB
test-dataproc:
image: ghcr.io/nismod/irv-autopkg:0.3.1-dev
volumes:
- ./tests:/usr/src/app/tests
env_file:
- envs/.api_and_dataproc.env
command: python -m unittest discover /usr/src/app/tests/dataproc