AutoMod/api/Dockerfile

17 lines
491 B
Docker
Raw Normal View History

FROM oven/bun:latest AS build
2022-07-12 18:07:17 +02:00
WORKDIR /build/app
2024-07-12 14:58:58 +02:00
COPY api/package.json api/bun.lockb ./
2022-07-12 18:07:17 +02:00
COPY lib ../lib
2024-07-12 14:58:58 +02:00
RUN cd ../lib && bun install --frozen-lockfile && bun run build
RUN bun install --frozen-lockfile
2022-07-12 18:07:17 +02:00
COPY ./api .
2024-07-12 14:58:58 +02:00
RUN bun run build
FROM oven/bun:latest AS prod
2022-07-12 18:07:17 +02:00
WORKDIR /app/api
2024-07-12 14:58:58 +02:00
COPY --from=build /build/app/package.json /build/app/bun.lockb ./
2022-07-12 18:07:17 +02:00
COPY --from=build /build/app/dist ./dist
COPY --from=build /build/lib ../lib
2024-07-12 14:58:58 +02:00
RUN bun install --production --frozen-lockfile
CMD ["bun", "start"]