refactor(Dockerfile): Update build process and entry point for TypeScript application
This commit is contained in:
20
Dockerfile
20
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"]
|
||||
|
||||
COPY ormconfig.js bunfig.toml tsconfig.json ./
|
||||
COPY src ./src
|
||||
|
||||
ENTRYPOINT ["bun", "/app/src/app.ts"]
|
||||
Reference in New Issue
Block a user