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 - EVENTS_USERNAME - EVENTS_PASSWORD - REDIS_URL - GOOGLE_CLOUD_VISION_API_KEY - CROWDIN_PROJECT_IDENTIFIER - CROWDIN_PROJECT_KEY - GEOLITE2_PATH - LOG_LEVEL_ROOT - LOG_LEVEL_MONGODB - INFLUXDB_HOST 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 # 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 run the incron jobs # Only root can run incron user: root command: ["incrond", "-n"] 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 ports: - ${PRODUCT_OPENER_EXPOSE}${PRODUCT_OPENER_PORT}:80 volumes: pgdata: icons_dist: js_dist: css_dist: node_modules: