src/index.ts
export const app = new Elysia({})
.get('/test', 'test')
.openapi({
references: fromTypes()
})
.listen(3000)
Dockerfile
FROM oven/bun:alpine AS build
WORKDIR /work
COPY package.json bun.lock bunfig.toml tsconfig.json ./
RUN bun install
COPY ./src ./src
ENV NODE_ENV=production
RUN bun build \
--compile \
--target bun \
--minify-whitespace \
--minify-syntax \
--outfile app \
src/index.ts
# Runtime
FROM alpine:3.22
RUN apk add --no-cache libstdc++
WORKDIR /work
COPY --from=build /work/app app
EXPOSE 3000
ENTRYPOINT ["./app"]
Got warn log when curl http://localhost:3000/openapi
elysia-template-1 | [1] Elysia is running at http://localhost:3000
elysia-template-1 | [@elysiajs/openapi/gen] Failed to generate OpenAPI schema
elysia-template-1 | warn: Couldn't find "src/index.ts" from /work
elysia-template-1 | at <anonymous> (/$bunfs/root/app:618:13921)
elysia-template-1 | at toOpenAPISchema (/$bunfs/root/app:414:147423)
elysia-template-1 | at <anonymous> (/$bunfs/root/app:633:2636)
elysia-template-1 | at handle (builtin:///$bunfs/root/app:12:47)
elysia-template-1 |
There will be no warning after removing references: fromTypes() .
src/index.ts
Dockerfile
Got warn log when curl http://localhost:3000/openapi
There will be no warning after removing
references: fromTypes().