Skip to content

Ship OpenAPI spec and healthcheck in Docker image #1282

Closed

Description

@greatest0fallt1me

Summary

The Dockerfile runner stage copies only node_modules and dist, but src/routes/index.ts reads docs/openapi.json via process.cwd() at import time and createApp loads it for express-openapi-validator. The image also uses npm install instead of npm ci, never runs prisma generate, and has no HEALTHCHECK.

Why this matters

The container crashes on boot with ENOENT, builds are non-reproducible, and orchestrators cannot detect unhealthy instances.

Scope

Copy docs/openapi.json (or embed it into dist at build), use npm ci in builder and deps stages, run npx prisma generate, and add HEALTHCHECK calling /api/health. Pass required secrets in docker-compose.yml via env_file.

Relevant code in CalloraOrg/Callora-Backend:

  • Dockerfile
  • docker-compose.yml
  • src/routes/index.ts
  • docs/openapi.json

Priority

High

Acceptance criteria

  • docker build and docker run start the server without ENOENT
  • The image contains the OpenAPI document at the path the code reads
  • docker inspect shows a HEALTHCHECK
  • docker-compose up starts with JWT_SECRET, ADMIN_API_KEY and METRICS_API_KEY supplied

Validation

Build with docker build -t callora . and run docker compose up; verify /api/health returns 200.

Non-goals

  • Typo-only, formatting-only, or cosmetic changes.
  • Unrelated refactors, dependency upgrades, or broad rewrites.
  • Removing safeguards or weakening validation to make tests pass.

Contributor application

Before coding, describe the affected modules, proposed state/invariant changes, test strategy, compatibility considerations, and an estimate. Wait for assignment before starting implementation.

PR requirements

Use a feature branch and include Closes #<issue-number>. Address every criterion, map criteria to code and tests, explain security and failure-mode handling, and ensure CI passes.

Quality review

A maintainer will assess correctness, completeness, test depth, compatibility, observability, and adverse-case handling. A substantive implementation is required; merge or CI status alone does not guarantee reward eligibility.


Generated by Claude Code

Activity

  1. changed the title [-]Keep leaderboard rank pages deterministic[/-] [+]Add focused test coverage for src/repositories/apiKeyRepository.ts[/+] on Sep 27, 2026
  2. changed the title [-]Add focused test coverage for src/repositories/apiKeyRepository.ts[/-] [+]Ship OpenAPI spec and healthcheck in Docker image[/+] on Sep 27, 2026
  3. olufunsoolutayo commented on Sep 27, 2026

    @olufunsoolutayo

    @olufunsoolutayo has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Please Maintainer, assign this issue to me. I'm grateful

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @olufunsoolutayo to this issue.

  4. Sam-Rytech commented on Sep 29, 2026

    @Sam-Rytech
    Contributor

    @Sam-Rytech has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi maintainer

    I'd like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Sam-Rytech to this issue.

  5. iyanumajekodunmi756 commented on Sep 29, 2026

    @iyanumajekodunmi756
    Contributor

    @iyanumajekodunmi756 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I would love to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @iyanumajekodunmi756 to this issue.

  6. drips-wave commented on Sep 30, 2026

    @drips-wave

    Congratulations, @iyanumajekodunmi756! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @iyanumajekodunmi756: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  7. grantfox-oss commented on Oct 1, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @iyanumajekodunmi756's PR #1430 was approved and merged by @greatest0fallt1me.

    🏆 @iyanumajekodunmi756: You earned 40 FoxPoints for this contribution! Your current tier: Builder (2,380 total points). Track your full progress on GrantFox.

    👏 Great work, @iyanumajekodunmi756! Keep contributing to CalloraOrg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveStellar Wave Program issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions