-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
121 lines (115 loc) · 3.5 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
version: '3.8'
services:
parcellaire-importer:
container_name: parcellaire-express-importer
build:
context: ./importer
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_HOST
- POSTGRES_SCHEMA
- DOWNLOAD_URL
- TEST_IMPORTER
- MAX_PARALLEL_DL
volumes:
- importer-data:/tmp
parcellaire-postgis:
container_name: parcellaire-express-postgis
build:
context: ./postgis
args:
- POSTGRES_VERSION
- POSTGIS_VERSION
environment:
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
# Exposition du port de la base de données pour test si nécessaire
# ports:
# - "5432:5432"
volumes:
- parcellaire-postgis-data:/var/lib/postgresql/data
# Options de configuration issues de PGTune (https://pgtune.leopard.in.ua)
# Valeurs par défaut pour une instance Hetzner CPX21
command:
- "postgres"
- "-c"
- "max_connections=100"
- "-c"
- "shared_buffers=1GB"
- "-c"
- "effective_cache_size=3GB"
- "-c"
- "maintenance_work_mem=256MB"
- "-c"
- "checkpoint_completion_target=0.9"
- "-c"
- "wal_buffers=16MB"
- "-c"
- "default_statistics_target=100"
- "-c"
- "random_page_cost=1.1"
- "-c"
- "effective_io_concurrency=200"
- "-c"
- "work_mem=2621kB"
- "-c"
- "min_wal_size=1GB"
- "-c"
- "max_wal_size=4GB"
- "-c"
- "max_worker_processes=4"
- "-c"
- "max_parallel_workers_per_gather=2"
- "-c"
- "max_parallel_workers=4"
- "-c"
- "max_parallel_maintenance_workers=2"
# Pour logguer l'intégralité des requêtes effectuées sur la base
# - "-c"
# - "log_statement=all"
shm_size: 2g
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER"]
interval: 1m
timeout: 5s
retries: 5
start_period: 10s
# Frontal web pour exploration de la base si nécessaire
# parcellaire-adminer:
# container_name: parcellaire-express-adminer
# image: adminer:4.8.1
# ports:
# - "8080:8080"
# environment:
# - ADMINER_DEFAULT_SERVER=${DB_HOST}
# - ADMINER_DESIGN=hydra
parcellaire-api:
container_name: parcellaire-express-api
build:
context: ./api
args:
- api_port=${API_PORT}
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_HOST
- POSTGRES_SCHEMA
- API_PORT
- MAX_FEATURE
ports:
- "${API_PORT}:${API_PORT}"
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:${API_PORT}/status || exit 1"]
interval: 1m
timeout: 5s
retries: 5
start_period: 10s
volumes:
parcellaire-postgis-data:
name: parcellaire-postgis-data
importer-data:
name: importer-data