Skip to content

build: adopt pyproject, harden image and Compose #204

Closed

Description

@uniqueg

Why?

proTES is packaged with setup.py, setup.cfg, two requirements files, a hand-maintained pro_tes/version.py and a stray file named =0.12.1 (pip output). The Dockerfile runs as root, installs the app in editable mode, makes pro_tes/api world-writable and has no health check; Gunicorn trusts X-Forwarded-* headers from any address (forwarded_allow_ips = "*"). Docker Compose publishes MongoDB (no auth), RabbitMQ (guest) and Flower (no auth) on all interfaces. cloud-registry, the template for FOCA apps, has solved all of these (elixir-cloud-aai/cloud-registry#97, elixir-cloud-aai/cloud-registry#120, elixir-cloud-aai/cloud-registry#142).

How?

  1. pyproject.toml as in cloud-registry: setuptools-scm (version from vX.Y.Z tags only, fallback_version), requires-python, bounded dependencies, extras dev and docs, package data (config.yaml, api/*.yaml), project URLs, authors "ELIXIR On-Cloud". Remove setup.py, setup.cfg, requirements.txt, requirements_dev.txt, pylintrc (moves to ruff in the style issue), pro_tes/version.py and =0.12.1; the app reads its version from the package metadata.
  2. Dockerfile as in cloud-registry: base image pinned by digest, dependencies installed from pyproject.toml before the code, non-editable install as root, USER 1000, no world-writable paths, HEALTHCHECK, Gunicorn CMD with pro_tes/gunicorn_config.py (no forwarded_allow_ips = "*"; documented option instead), SETUPTOOLS_SCM_PRETEND_VERSION build argument, OCI labels with ELIXIR On-Cloud.
  3. Celery worker command that works with the installed package (no cd /app/pro_tes).
  4. Docker Compose: pinned images, ports on 127.0.0.1, health checks (docker compose up --wait), no links/version, broker credentials via CELERY_BROKER_URL from the environment, Flower in an opt-in profile with basic auth, a config.dev.yaml overlay (FOCA_CONFIG_OVERLAY) for local development.
  5. .dockerignore, .github/dependabot.yml (pip, GitHub Actions, Docker, pre-commit; FOCA minors bumped by hand) as in cloud-registry.
  6. CI installs with pip install -e ".[dev]"; the image build passes the version.

Acceptance criteria

  • pip install . and python -m build work; the wheel contains only pro_tes and its data; the version comes from Git tags.
  • The image runs as non-root and has a health check; docker compose up --wait starts proTES, the worker, MongoDB and RabbitMQ, with no port published beyond 127.0.0.1.
  • The removed files are gone, and nothing refers to them.

Activity

  1. added
    priority: medium
    status: blocked
    type: delivery
    type: security
    workload: days
    on Oct 22, 2026
  2. added
    status: in progress
    and removed
    status: blocked
    on Oct 22, 2026
  3. removed
    status: in progress
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtype: deliverytype: securityworkload: days

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions