Repository navigation
Closed
Labels
priority: mediumMedium prioritytype: deliveryRelated to packaging, deployment etc.type: securityRelated to securityworkload: hoursLikely takes hours to resolve
Description
Why?
The Docker image and the Compose setup work, but are slow to build, larger and less safe than necessary:
Dockerfilecopies the whole repository (COPY ./ /app) beforepip install -e ., so every code change reinstalls all dependencies; the editable install is not needed in an image. There is noHEALTHCHECK..dockerignoreonly excludes Git files, Markdown and egg-info; tests,deployment/,docs/, virtual environments, caches and local data end up in the build context and the image.docker-compose.yaml:- publishes MongoDB's port (
"27017:27017") on all host interfaces, without authentication; - uses
mongo:3.6(end of life since 2021; production uses a different version, see Deployment: pin MongoDB, add DB auth, probes #68); - bind-mounts
../data/cloud-registry/db, a directory outside the repository; - uses the legacy
linksinstead ofdepends_onwith a health check, so the app can start before MongoDB is ready; - tags the local build as
elixircloud/cloud-registry:0.1.0, a stale public image name, sodocker compose upwithout--buildmay pull an old image; - has the obsolete top-level
versionkey.
- publishes MongoDB's port (
How?
- Dockerfile: copy
requirements.txtandpyproject.tomlfirst and install dependencies in their own layer, then copy the package and install it non-editably; add aHEALTHCHECKagainst/ga4gh/registry/v1/service-info(using Python or a tool available in the FOCA base image). .dockerignore: exclude everything not needed at runtime (tests/,deployment/,docs/,.venv, caches, coverage files, local data).- Compose: don't publish 27017 (or bind it to
127.0.0.1in an optional override); use a named volume;depends_onwithcondition: service_healthyand amongoshhealth check; pin the same MongoDB version as the Helm chart (Deployment: pin MongoDB, add DB auth, probes #68); use a local image name (e.g.cloud-registry:local); dropversion. - Update the README (Docs: update README and Read the Docs build #80) and the CI smoke test (CI: pass on fork and Dependabot PRs, modernize workflow #69) if commands change.
Acceptance criteria
- Changing a Python file in
cloud_registry/rebuilds the image without reinstalling dependencies. -
docker compose up --buildstarts reliably on a clean machine; MongoDB is not reachable from outside the host. - The image contains no tests, chart or docs;
docker inspectshows a health check.
Metadata
Metadata
Assignees
Labels
priority: mediumMedium prioritytype: deliveryRelated to packaging, deployment etc.type: securityRelated to securityworkload: hoursLikely takes hours to resolve
Activity