-
Notifications
You must be signed in to change notification settings - Fork 22
/
docker-compose.yml
107 lines (100 loc) · 2.95 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
version: "2.2"
volumes:
postgis-data:
networks:
poi_network:
services:
api:
container_name: ops-api
build: .
volumes:
- ./osm:/deploy/app/osm
- ./ops_settings_docker.yml:/deploy/app/openpoiservice/server/ops_settings.yml
- ./categories_docker.yml:/deploy/app/openpoiservice/server/categories/categories.yml
ports:
- "5000:5000"
depends_on:
db:
condition: service_healthy
mem_limit: 28g
networks:
- poi_network
# Don't forget to change the host name inside ops_settings_docker.yml by the one given to docker container.
# Also port should be set to 5432 (default value) inside the same file since they are on the same network
db:
container_name: ops-db
image: postgis/postgis:16-3.4
volumes:
- postgis-data:/var/lib/postgresql
environment:
# If you need to create multiple database you can add coma separated databases eg gis,data
- POSTGRES_DB=gis
- POSTGRES_USER=gis_admin # Here it's important to keep the same name as the one configured inside ops_settings_docker.yml
- POSTGRES_PASSWORD=admin # Here it's important to keep the same name as the one configured inside ops_settings_docker.yml
- POSTGRES_DBNAME=gis # Here it's important to keep the same name as the one configured inside ops_settings_docker.yml
- ALLOW_IP_RANGE=0.0.0.0/0
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "${POSTGRES_DB}"]
interval: 10s
timeout: 10s
retries: 10
restart: on-failure
networks:
- poi_network
# These two services will not start by default and can be run as necessary:
# docker-compose up init
# docker-compose up update
init:
container_name: ops-init
build: .
environment:
- INIT_DB=1
volumes:
- ./osm:/deploy/app/osm
- ./import-log.json:/deploy/app/import-log.json
- ./ops_settings_docker.yml:/deploy/app/openpoiservice/server/ops_settings.yml
- ./categories_docker.yml:/deploy/app/openpoiservice/server/categories/categories.yml
depends_on:
db:
condition: service_healthy
mem_limit: 28g
networks:
- poi_network
profiles:
- init
update:
container_name: ops-update
build: .
environment:
- UPDATE_DB=1
volumes:
- ./osm:/deploy/app/osm
- ./import-log.json:/deploy/app/import-log.json
- ./ops_settings_docker.yml:/deploy/app/openpoiservice/server/ops_settings.yml
- ./categories_docker.yml:/deploy/app/openpoiservice/server/categories/categories.yml
depends_on:
db:
condition: service_healthy
mem_limit: 28g
networks:
- poi_network
profiles:
- update
test:
container_name: ops-test
build: .
environment:
- TESTING=True
volumes:
- ./osm:/deploy/app/osm
- ./osm_test:/deploy/app/osm_test
- ./ops_settings_docker.yml:/deploy/app/openpoiservice/server/ops_settings.yml
- ./categories_docker.yml:/deploy/app/openpoiservice/server/categories/categories.yml
depends_on:
db:
condition: service_healthy
mem_limit: 8g
networks:
- poi_network