forked from openfoodfacts/openfoodfacts-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
134 lines (122 loc) · 4.17 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
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
- 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
- INFLUXDB_HOST
- BUILD_CACHE_REPO
depends_on:
- memcached
volumes:
# pointer to openfoodfacts-web/lang
- ${WEB_LANG_PATH}:/mnt/podata/lang
# Static data (e.g dumps)
- html_data:/opt/product-opener/html/data
# 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
# 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/apache.conf:/etc/apache2/sites-enabled/product-opener.conf
- ./conf/apache-mpm_prefork.conf:/etc/apache2/mods-avalable/mpm_prefork.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
# Logs
- ./logs/nginx/:/var/log/nginx/
# Nginx, we use templates dir to be able to use environment vars
- ./conf/nginx.conf:/etc/nginx/templates/default.conf.template
# cors headers definition as an include
- ./conf/nginx/snippets/off.cors-headers.include:/etc/nginx/conf.d/off.cors-headers.include
# some expires rules
- ./conf/nginx/expires-no-json-xml.conf:/etc/nginx/conf.d/expires-no-json-xml.include
# some redirects
- ./conf/nginx/snippets/off.locations-redirects.include:/etc/nginx/conf.d/off.locations-redirects.include
ports:
- ${PRODUCT_OPENER_EXPOSE}${PRODUCT_OPENER_PORT}:80
volumes:
pgdata:
icons_dist:
js_dist:
css_dist:
node_modules: