From fb2e7dad12a08ef668785d5a97f5e1899a6ca999 Mon Sep 17 00:00:00 2001 From: Izan Gil <66965250+SrIzan10@users.noreply.github.com> Date: Fri, 19 Sep 2025 20:21:48 +0200 Subject: [PATCH] chore: dockerfile --- Dockerfile | 24 ++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..11f7ab7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM oven/bun:latest AS builder + +WORKDIR /app + +COPY package.json bun.lockb* ./ + +RUN bun install + +COPY . . + +RUN bun run build + +RUN bunx prisma generate + +FROM oven/bun:latest + +WORKDIR /app + +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/prisma ./prisma +COPY --from=builder /app/package.json ./ + +CMD ["sh", "-c", "bunx prisma migrate deploy && bun run ."] \ No newline at end of file diff --git a/package.json b/package.json index 37b85ed..8fc0adb 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "main": "dist/index.js", "scripts": { "build": "sern build", - "start": "bunx prisma generate && bunx prisma migrate deploy && bun run .", + "start": "bunx prisma migrate deploy && bun run .", "install": "sern build", "commands:publish": "sern commands publish", "dev": "sern build -w --watch-command \"bun start\""