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\""