-
-
Notifications
You must be signed in to change notification settings - Fork 662
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
210 lines (197 loc) 路 7.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
210 lines (197 loc) 路 7.06 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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
x-backend-conf: &backend-conf
image: ghcr.io/openfoodfacts/openfoodfacts-server/backend:${TAG}
environment:
- PRODUCERS_PLATFORM
- PRODUCT_OPENER_DOMAIN
- PRODUCT_OPENER_PORT
- PRODUCT_OPENER_FLAVOR
- PRODUCT_OPENER_FLAVOR_SHORT
- OFF_LOG_EMAILS
- MONGODB_HOST
- MONGODB_DATABASE
- POSTGRES_HOST
- POSTGRES_USER
- POSTGRES_PASSWORD
- ROBOTOFF_URL
- QUERY_URL
- EVENTS_URL
- FACETS_KP_URL
- EVENTS_USERNAME
- EVENTS_PASSWORD
- REDIS_URL
- FOLKSONOMY_URL
- GOOGLE_CLOUD_VISION_API_KEY
- GOOGLE_CLOUD_VISION_API_URL
- CROWDIN_PROJECT_IDENTIFIER
- CROWDIN_PROJECT_KEY
- BREVO_API_KEY
- BREVO_LIST_ID
- ECOBALYSE_API_TOKEN
- GEOLITE2_PATH
- LOG_LEVEL_ROOT
- LOG_LEVEL_MONGODB
- LOG_LEVEL_RATE_LIMITER
- NUTRIPATROL_URL
- INFLUXDB_HOST
- BUILD_CACHE_REPO
- RATE_LIMITER_BLOCKING_ENABLED
- ODOO_CRM_URL
- ODOO_CRM_DB
- ODOO_CRM_USER
- ODOO_CRM_PASSWORD
- OIDC_IMPLEMENTATION_LEVEL
- OIDC_DISCOVERY_URL
- OIDC_CLIENT_ID
- OIDC_CLIENT_SECRET
- RECIPE_ESTIMATOR_URL
- RECIPE_ESTIMATOR_SERVICE
- SLACK_HOOK_URLS
#11901: Remove once production is migrated
- SERIALIZE_TO_JSON
depends_on:
memcached:
condition: service_started
volumes:
# pointer to openfoodfacts-web/lang
- ${WEB_RESOURCES_PATH}/lang:/mnt/podata/lang
# pointer to openfoodfacts-web/html
- ${WEB_RESOURCES_PATH}/html:/opt/product-opener/html/off_web_html
# Static data (e.g dumps)
- html_data:/opt/product-opener/html/data
# other servers dirs (this is temporary to be able to develop for now)
- other_servers:/srv
# Binds from frontend container (read-only)
- icons_dist:/opt/product-opener/html/images/icons/dist:ro
- js_dist:/opt/product-opener/html/js/dist:ro
- css_dist:/opt/product-opener/html/css/dist:ro
- node_modules:/opt/product-opener/node_modules:ro
# Users, products, product images and orgs files
- users:/mnt/podata/users # .sto
- products:/mnt/podata/products # .sto
- product_images:/opt/product-opener/html/images/products # .jpg
- orgs:/mnt/podata/orgs # .sto
# build-cache
- build_cache:/mnt/podata/build-cache
# export_files folders must be accessible between pro and public instances
- export_files:/mnt/podata/export_files
# all the rest
- podata:/mnt/podata
# Logs
- ./logs/apache2:/var/log/apache2
- ./logs/apache2:/mnt/podata/logs
- ./logs/apache2:/var/log/httpd
# Apache conf
- ./conf/apache2-docker/apache.conf:/etc/apache2/sites-enabled/product-opener.conf
- ./conf/apache2-docker/apache-mpm_prefork.conf:/etc/apache2/mods-enabled/mpm_prefork.conf
- ./conf/apache-2.4/modperl.conf:/etc/apache2/conf-enabled/modperl.conf
services:
memcached:
image: memcached:1.6-alpine
postgres:
image: pgautoupgrade/pgautoupgrade:17-alpine
# we want postgres for off, but not for pro profile
profiles: ["off"]
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB=minion
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
start_interval: 1s
start_period: 60s
retries: 2
volumes:
- pgdata:/var/lib/postgresql/data
backend: *backend-conf
minion:
<<: *backend-conf
# This service run the minion, see https://docs.mojolicious.org/Minion/
command:
- "/opt/product-opener/scripts/minion_producers.pl"
- "minion"
- "worker"
- "-m"
- "$MINION_MODE"
- "-q"
- "$MINION_QUEUE"
incron:
<<: *backend-conf
# This service watches for new images to trigger ocr and robotoff processing
command:
["perl", "scripts/run_cloud_vision_ocr.pl", "/mnt/podata/new_images"]
redis-listener:
<<: *backend-conf
# we want the redis_listerner for off, but not for pro profile
profiles: ["off"]
# This service watches for new events on a redis stream to delete users
command: ["perl", "scripts/listen_to_redis_stream.pl"]
frontend:
image: ghcr.io/openfoodfacts/openfoodfacts-server/frontend:${TAG}
depends_on:
- backend
environment:
- PRODUCT_OPENER_DOMAIN
networks:
default:
aliases:
- openfoodfacts.localhost
- world.openfoodfacts.localhost
ports:
- ${PRODUCT_OPENER_EXPOSE}${PRODUCT_OPENER_PORT}:80
volumes:
- product_images:/opt/product-opener/html/images/products:ro
- html_data:/opt/product-opener/html/data:ro
- ./html/donate:/opt/product-opener/html/donate:ro
# Static dist/ assets (JS, CSS, Icons, Image attributes) generated by gulp
# if you add a volume, add it to dev.yml / dynamicfront
# Note: we need them because we need this data in backend and minion
# In prod they MUST be removed and recreated each time, so that image data is freshly copied
- icons_dist:/opt/product-opener/html/images/icons/dist
- js_dist:/opt/product-opener/html/js/dist
- css_dist:/opt/product-opener/html/css/dist
- node_modules:/opt/product-opener/node_modules
# openfoodfacts-web static files
- ${WEB_RESOURCES_PATH}/html:/opt/product-opener/html/off_web_html
# Logs
- ./logs/nginx/:/var/log/nginx/
# Nginx, we use templates dir to be able to use environment vars
- ./conf/nginx-docker/nginx.conf:/etc/nginx/templates/default.conf.template
# needed for monitoring
- ./conf/nginx/sites-available/default:/etc/nginx/conf.d/stub_status.conf
# common directives
# cors headers definition as an include
- ./conf/nginx/snippets/cors-headers.include:/etc/nginx/snippets/cors-headers.include
# configurations for product-opener
- ./conf/nginx/snippets/productopener-mappings.include:/etc/nginx/snippets/productopener-mappings.include
- ./conf/nginx/snippets/productopener-server.include:/etc/nginx/snippets/productopener-server.include
- ./conf/nginx/snippets/productopener-uploads-defaults.include:/etc/nginx/snippets/productopener-uploads-defaults.include
- ./conf/nginx/snippets/productopener-uploads-large.include:/etc/nginx/snippets/productopener-uploads-large.include
# some expires rules
- ./conf/nginx/snippets/expiry-headers.include:/etc/nginx/snippets/expiry-headers.include
- ./conf/nginx/snippets/expires-no-json-xml.conf:/etc/nginx/conf.d/aa_expires-no-json-xml.conf
# log format
- ./conf/nginx/conf.d/log_format_realip.conf:/etc/nginx/conf.d/aa_log_format_realip.conf
# some redirects
- ./conf/nginx/snippets/off.locations-redirects.include:/etc/nginx/snippets/off.locations-redirects.include
volumes:
pgdata:
icons_dist:
js_dist:
css_dist:
node_modules:
# build_cache does not needs not be external, for wiping it will avoid keeping too much cached data
build_cache:
other_servers:
# volumes redefined in other docker compose
html_data:
users:
products:
product_images:
orgs:
export_files:
podata:
networks:
default:
name: ${PRODUCT_OPENER_NETWORK:-product-opener}