fix(docker): include OpenAPI spec in runtime image#2007
Merged
diegosouzapw merged 1 commit intodiegosouzapw:release/v3.8.0from May 7, 2026
Merged
fix(docker): include OpenAPI spec in runtime image#2007diegosouzapw merged 1 commit intodiegosouzapw:release/v3.8.0from
diegosouzapw merged 1 commit intodiegosouzapw:release/v3.8.0from
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Dockerfile to explicitly copy the OpenAPI specification file into the final image. This ensures the file is available at runtime for the Endpoints dashboard, as it is not automatically included by Next.js standalone tracing. I have no feedback to provide as there were no review comments.
Owner
|
Thank you @tatsster for your contribution! This has been reviewed and is now merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR includes
docs/openapi.yamlin the Docker runtime image.It fixes the Endpoints dashboard showing:
when OmniRoute is deployed from the published Docker image with Docker Compose.
Affected setup
The issue was seen with a straightforward Docker Compose deployment using the published image:
In this setup the app itself starts normally and the dashboard is reachable, but the Endpoints dashboard cannot load the OpenAPI catalog because
/api/openapi/speccannot findopenapi.yamlinside the container.Root cause
src/app/api/openapi/spec/route.tsreads the OpenAPI spec from disk at runtime:However, the Docker image uses Next.js standalone output:
COPY --from=builder /app/.next/standalone ./Files that are read dynamically with
fsare not always included in the standalone output. The current Dockerfile already handles this pattern for other runtime filesystem assets, for example migrations are copied explicitly:COPY --from=builder /app/src/lib/db/migrations ./migrationsdocs/openapi.yamlneeds the same treatment because it is read by/api/openapi/specat runtime for the Endpoints dashboard.Fix
Copy the OpenAPI spec into the runtime image:
COPY --from=builder /app/docs/openapi.yaml ./docs/openapi.yamlThis makes the file available at
/app/docs/openapi.yaml, which matches the route's existing lookup path when the container runs withWORKDIR /app.Screenshot
Current behavior before this fix:
Testing
package.jsonExpected result after rebuilding the image
After rebuilding/redeploying the Docker image from this Dockerfile,
/app/docs/openapi.yamlshould exist in the container and the Endpoints dashboard should be able to load the OpenAPI endpoint catalog instead of showingopenapi.yaml not found.