23 lines
750 B
Docker
23 lines
750 B
Docker
# Typescript Build
|
|
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 \
|
|
&& bun install --production --frozen-lockfile
|
|
|
|
# final image
|
|
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"] |