AutoMod/api/Dockerfile
2024-07-12 20:58:58 +08:00

16 lines
481 B
Docker

FROM oven/bun:1 as build
WORKDIR /build/app
COPY api/package.json api/bun.lockb ./
COPY lib ../lib
RUN cd ../lib && bun install --frozen-lockfile && bun run build
RUN bun install --frozen-lockfile
COPY ./api .
RUN bun run build
FROM oven/bun:1 as prod
WORKDIR /app/api
COPY --from=build /build/app/package.json /build/app/bun.lockb ./
COPY --from=build /build/app/dist ./dist
COPY --from=build /build/lib ../lib
RUN bun install --production --frozen-lockfile
CMD ["bun", "start"]