Skip to content

OBF multi-deployment guide uses the wrong host port variable and an unavailable Compose profile #14269

Description

@TaciteOFF

The Open Beauty Facts example in docs/dev/how-to-develop-using-docker.md does not match the current Docker Compose configuration.

There seem to be two separate issues:

  1. The guide changes PRODUCT_OPENER_PORT from 80 to 81, but
    docker/dev.yml also publishes PRODUCT_OPENER_HOST_PORT, which remains
    set to 80 in the copied .env file.

  2. The guide sets COMPOSE_PROFILES=obf, but docker compose config --profiles
    currently only reports the off profile. postgres and redis-listener
    are assigned to that off profile.

  3. The default Docker network name is hard-coded as product-opener in
    docker-compose.yml. As a result, the OFF and OBF Compose projects join
    the same internal network even though they have different
    COMPOSE_PROJECT_NAME values. Both projects then register identical
    network aliases such as backend, frontend, postgres and memcached,
    making service-name resolution ambiguous between the two deployments.

  4. The Docker configuration still selects the off MongoDB database for an
    OBF flavor. Config2_docker.pm sets:

    $mongodb = $producers_platform ? "off-pro" : "off";

and Config_obf.pm reuses that value instead of selecting the obf
database. Therefore, an instance configured with
PRODUCT_OPENER_FLAVOR=openbeautyfacts and
PRODUCT_OPENER_FLAVOR_SHORT=obf still queries MongoDB database off.

The only available Compose profile is off.

postgres and redis-listener are not included with COMPOSE_PROFILES=obf.

The frontend configuration contains both:
published: "81"
published: "80"

Starting OBF alongside OFF therefore still attempts to bind host port 80.

Suggested changes :

  1. Add PRODUCT_OPENER_HOST_PORT=81 to the documented OBF configuration.
  2. Clarify whether OBF should keep COMPOSE_PROFILES=off, or add obf to the profiles of services required by every public flavor.
  3. Consider updating env/env.obf so it also overrides the domain, host port and Minion queue required to run OBF alongside OFF.
  4. Make the default Product Opener network name configurable or project-scoped, for example:
networks:
  default:
    name: ${PRODUCT_OPENER_NETWORK:-product-opener}
  1. Select the MongoDB database from the configured flavor, or introduce an explicit environment variable such as MONGODB_DATABASE. For example, PRODUCT_OPENER_FLAVOR_SHORT=obf should result in mongodb=obf.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    To discuss and validate

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions