forked from openfoodfacts/openfoodfacts-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
157 lines (143 loc) · 5.15 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
version: "3.7"
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
- POSTGRES_HOST
- POSTGRES_USER
- POSTGRES_PASSWORD
- ROBOTOFF_URL
- QUERY_URL
- EVENTS_URL
- FACETS_KP_URL
- EVENTS_USERNAME
- EVENTS_PASSWORD
- REDIS_URL
- GOOGLE_CLOUD_VISION_API_KEY
- GOOGLE_CLOUD_VISION_API_URL
- CROWDIN_PROJECT_IDENTIFIER
- CROWDIN_PROJECT_KEY
- 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
depends_on:
- memcached
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: postgres:12-alpine
# we want postgres for off, but not for pro profile
profiles: ["off"]
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB=minion
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 watch for new images to trigger ocr and robotoff processing
command: ["perl", "scripts/run_cloud_vision_ocr.pl", "/mnt/podata/new_images"]
frontend:
image: ghcr.io/openfoodfacts/openfoodfacts-server/frontend:${TAG}
depends_on:
- backend
environment:
- PRODUCT_OPENER_DOMAIN
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
# cors headers definition as an include
- ./conf/nginx/snippets/off.cors-headers.include:/etc/nginx/snippets/off.cors-headers.include
- ./conf/nginx/snippets/expiry-headers.include:/etc/nginx/snippets/expiry-headers.include
# some expires rules
- ./conf/nginx/snippets/expires-no-json-xml.conf:/etc/nginx/snippets/expires-no-json-xml.conf
# some redirects
- ./conf/nginx/snippets/off.locations-redirects.include:/etc/nginx/snippets/off.locations-redirects.include
ports:
- ${PRODUCT_OPENER_EXPOSE}${PRODUCT_OPENER_PORT}:80
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: