fix: copy openapi.yaml into Docker production image#169
fix: copy openapi.yaml into Docker production image#1690x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
Conversation
The Dockerfile runner stage only copied dist/, node_modules/, and package.json from the builder. The openapi.yaml file (read at runtime by /docs/openapi.yaml endpoint via fs.readFile) was never included, causing a guaranteed 500 error on the /docs endpoint in production. The builder stage also never copied it in (only package.json, lockfiles, tsconfig, and src/). Since openapi.yaml is a runtime asset not needed at build time, copy it directly from the build context into the runner stage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 6 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
openapi.yamlinto the production image. The/docs/openapi.yamlendpoint reads it at runtime viafs.readFile("/app/openapi.yaml"), but that file doesn't exist in the container — guaranteed 500 error on the/docsendpoint in production.package.json, lockfiles,tsconfig.json, andsrc/. Runner stage only copiesdist/,node_modules/,package.json.tscdoesn't copy non-TS files.openapi.yamllives at the project root, outsidesrc/.COPY openapi.yaml ./to the runner stage (1 line).Path trace
Test plan
tsc --noEmitpassesvitest runpasses (186/186 tests)/app/openapi.yamlexists in final imagecurl localhost:3001/docs/openapi.yamlreturns YAML, not 500🤖 Generated with Claude Code