diff --git a/Dockerfile b/Dockerfile index 40a9342..14a7f23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,23 @@ -# Typescript Build +# Build stage - install dependencies FROM registry.odit.services/hub/oven/bun:1.3.9-alpine AS build WORKDIR /app COPY package.json bun.lockb* ./ RUN bun install --frozen-lockfile -COPY tsconfig.json ormconfig.js bunfig.toml ./ -COPY src ./src -RUN bun run build \ - && rm -rf /app/node_modules \ +# Production dependencies only +RUN rm -rf /app/node_modules \ && bun install --production --frozen-lockfile -# final image +# Final image - run TypeScript directly FROM registry.odit.services/hub/oven/bun:1.3.9-alpine AS final WORKDIR /app + COPY --from=build /app/package.json /app/package.json COPY --from=build /app/bun.lockb* /app/ -COPY --from=build /app/ormconfig.js /app/ormconfig.js -COPY --from=build /app/bunfig.toml /app/bunfig.toml -COPY --from=build /app/dist /app/dist COPY --from=build /app/node_modules /app/node_modules -ENTRYPOINT ["bun", "/app/dist/app.js"] \ No newline at end of file + +COPY ormconfig.js bunfig.toml tsconfig.json ./ +COPY src ./src + +ENTRYPOINT ["bun", "/app/src/app.ts"] \ No newline at end of file diff --git a/bunfig.toml b/bunfig.toml index c9124e4..1a3e591 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -4,3 +4,10 @@ [runtime] # Enable Node.js compatibility mode bun = true + +# TypeScript transpiler settings +# Required for TypeORM decorators +[transpiler] +tsconfig = "tsconfig.json" +emitDecoratorMetadata = true +experimentalDecorators = true diff --git a/package.json b/package.json index b52d885..dcdfee5 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "scripts": { "dev": "bun --watch src/app.ts", "start": "bun src/app.ts", - "build": "rimraf ./dist && tsc && cp-cli ./src/static ./dist/static", "docs": "typedoc --out docs src", "test": "jest", "test:watch": "jest --watchAll", @@ -103,4 +102,4 @@ "after:bump": "bun run changelog:export && bun run licenses:export && git add CHANGELOG.md && git add licenses.md" } } -} +} \ No newline at end of file