-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
195 lines (171 loc) · 6.64 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
x-restart-policy: &restart-policy
restart: ${RESTART_POLICY:-unless-stopped}
x-defaults: &defaults
user: ${UID}:${GID}
x-env-defaults: &env-defaults
http_proxy: ${HTTP_PROXY:-}
https_proxy: ${HTTPS_PROXY:-}
x-geonature-depends-on-defaults: &geonature-depends-on-defaults
redis:
condition: service_healthy
x-geonature-backend-env: &geonature-backend-env
<<: *env-defaults
GEONATURE_SQLALCHEMY_DATABASE_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT:-5432}/${POSTGRES_DB}
GEONATURE_URL_APPLICATION: ${GEONATURE_FRONTEND_PROTOCOL}://${GEONATURE_FRONTEND_HOSTPORT}${GEONATURE_FRONTEND_PREFIX}
GEONATURE_API_ENDPOINT: ${GEONATURE_BACKEND_PROTOCOL}://${GEONATURE_BACKEND_HOSTPORT}${GEONATURE_BACKEND_PREFIX}
GEONATURE_API_TAXHUB: ${TAXHUB_PROTOCOL}://${TAXHUB_HOSTPORT}${TAXHUB_API_PREFIX}
GEONATURE_CONFIG_FILE: ${GEONATURE_CONFIG_FILE:-/dist/config/geonature_config.toml}
GEONATURE_CELERY__broker_url: ${GEONATURE_CELERY__broker_url:-redis://redis}
GEONATURE_CELERY__result_backend: ${GEONATURE_CELERY__result_backend:-redis://redis}
x-geonature-backend-defaults: &geonature-backend-defaults
<<: *defaults
image: ${GEONATURE_BACKEND_EXTRA_IMAGE}
# build: ./
depends_on:
<<: *geonature-depends-on-defaults
volumes:
- ./config/geonature:/dist/config
- ./data/geonature/media:${GEONATURE_MEDIA_FOLDER:-/dist/media}
- ./data/geonature/custom:${GEONATURE_CUSTOM_STATIC_FOLDER:-/dist/custom}
- ./sources:/sources
environment:
<<: *geonature-backend-env
services:
redis:
<<: *restart-policy
image: ${REDIS_IMAGE:-redis:7-alpine}
container_name: ${STACK_NAME:-geonature}_redis
volumes:
- redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
_net_geonature:
usershub:
<<: [*restart-policy, *defaults]
image: ${USERSHUB_IMAGE}
container_name: ${STACK_NAME:-geonature}_usershub
depends_on:
geonature-install-db:
condition: service_completed_successfully
volumes:
- ./config/usershub:/dist/config/
environment:
<<: *env-defaults
USERSHUB_URL_APPLICATION: "${USERSHUB_PROTOCOL}://${USERSHUB_HOSTPORT}${USERSHUB_PREFIX}"
USERSHUB_SQLALCHEMY_DATABASE_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT:-5432}/${POSTGRES_DB}
USERSHUB_SETTINGS: ${USERSHUB_SETTINGS:-/dist/config/config.py}
USERSHUB_ACTIVATE_APP: ${USERSHUB_ACTIVATE_APP:-true}
USERSHUB_ACTIVATE_API: ${USERSHUB_ACTIVATE_API:-true}
USERSHUB_COOKIE_EXPIRATION: ${USERSHUB_COOKIE_EXPIRATION:-3600}
USERSHUB_FILL_MD5_PASS: ${USERSHUB_FILL_MD5_PASS:-false}
VIRTUAL_HOST: ${USERSHUB_HOST}
LETSENCRYPT_HOST: ${USERSHUB_HOST}
VIRTUAL_PATH: ${USERSHUB_PREFIX}
networks:
proxy:
_net_geonature:
taxhub:
<<: [*restart-policy, *defaults]
image: ${TAXHUB_IMAGE}
container_name: ${STACK_NAME:-geonature}_taxhub
depends_on:
geonature-install-db:
condition: service_completed_successfully
volumes:
- ./config/taxhub:/dist/config
- ./data/taxhub/medias:${TAXHUB_STATIC_FOLDER:-/dist/static}/medias
environment:
<<: *env-defaults
TAXHUB_APPLICATION_ROOT: "${TAXHUB_PREFIX}"
TAXHUB_SQLALCHEMY_DATABASE_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT:-5432}/${POSTGRES_DB}
TAXHUB_SETTINGS: ${TAXHUB_SETTINGS:-/dist/config/config.py}
TAXHUB_UPLOAD_FOLDER: "medias"
TAXHUB_SQLALCHEMY_TRACK_MODIFICATIONS: False
TAXHUB_COOKIE_EXPIRATION: 3600
TAXHUB_PASS_METHOD: "hash"
VIRTUAL_HOST: ${TAXHUB_HOST}
LETSENCRYPT_HOST: ${TAXHUB_HOST}
VIRTUAL_PATH: ${TAXHUB_PREFIX}
networks:
proxy:
_net_geonature:
geonature-install-db:
<<: *geonature-backend-defaults
#command: "geonature permissions supergrant --yes ${GEONATURE_SUPERGRANT_ARGS:---help}"
container_name: ${STACK_NAME:-geonature}_geonature_install_db
entrypoint: ["bash","-c","echo 'ok'"]
environment:
<<: *geonature-backend-env
srid_local: ${GEONATURE_DB_LOCAL_SRID}
add_sample_data: ${GEONATURE_DB_ADD_SAMPLE_DATA:-false}
install_bdc_statuts: ${GEONATURE_DB_INSTALL_BDC_STATUTS:-true}
install_sig_layers: ${GEONATURE_DB_INSTALL_SIG_LAYERS:-true}
install_grid_layer: ${GEONATURE_DB_INSTALL_GRID_LAYER:-true}
install_ref_sensitivity: ${GEONATURE_DB_INSTALL_REF_SENSITIVITY:-true}
usershub: ${GEONATURE_DB_INSTALL_USERSHUB:-true}
usershub_samples: ${GEONATURE_DB_INSTALL_USERSHUB_SAMPLES:-true}
taxhub: ${GEONATURE_DB_INSTALL_TAXHUB:-true}
taxhub_samples: ${GEONATURE_DB_INSTALL_TAXHUB_SAMPLES:-true}
networks:
_net_geonature:
geonature-worker:
<<: [*restart-policy, *geonature-backend-defaults]
container_name: ${STACK_NAME:-geonature}_geonature_worker
depends_on:
<<: *geonature-depends-on-defaults
geonature-install-db:
condition: service_completed_successfully
entrypoint: []
command: celery -A geonature.celery_app:app worker --beat --schedule-filename=/dist/media/celerybeat-schedule.db
networks:
_net_geonature:
geonature-backend:
<<: [*restart-policy, *geonature-backend-defaults]
container_name: ${STACK_NAME:-geonature}_geonature_backend
depends_on:
<<: *geonature-depends-on-defaults
geonature-install-db:
condition: service_completed_successfully
entrypoint: []
command:
- "gunicorn"
- "geonature:create_app()"
- "--name=geonature"
- "--workers=2"
- "--threads=2"
- "--access-logfile=-"
- "--bind=0.0.0.0:8000"
- "--reload"
- "--reload-extra-file=${GEONATURE_CONFIG_FILE:-/dist/config/geonature_config.toml}"
environment:
<<: *geonature-backend-env
VIRTUAL_HOST: ${GEONATURE_BACKEND_HOST}
LETSENCRYPT_HOST: ${GEONATURE_BACKEND_HOST}
VIRTUAL_PATH: ${GEONATURE_BACKEND_PREFIX}
networks:
proxy:
_net_geonature:
geonature-frontend:
<<: *restart-policy
image: ${GEONATURE_FRONTEND_EXTRA_IMAGE}
container_name: ${STACK_NAME:-geonature}_geonature_frontend
environment:
- NGINX_LOCATION=${GEONATURE_FRONTEND_PREFIX}
- API_ENDPOINT="${GEONATURE_BACKEND_PROTOCOL}://${GEONATURE_BACKEND_HOSTPORT}${GEONATURE_BACKEND_PREFIX}"
- VIRTUAL_HOST=${GEONATURE_FRONTEND_HOST}
- LETSENCRYPT_HOST=${GEONATURE_FRONTEND_HOST}
- VIRTUAL_PATH=${GEONATURE_FRONTEND_PREFIX}
networks:
proxy:
_net_geonature:
volumes:
redis:
networks:
proxy:
name: proxy
external: true
_net_geonature: