Is Better-SQLITE3 necessary ?

Hello, I’m using Better Auth with Bun, Hono, and Prisma (Postgres), and I’m having an issue when building my app in the bun:alpine image. I either have to: - download a lot of packages for SQLite3 just to build (which takes more than 30 seconds), or - skip downloading the dependencies, in which case the SQLite postinstall fails. Is it possible to avoid downloading this dependency?
FROM oven/bun:alpine

# Stuff for better-sqlite3
RUN apk add --no-cache openssl curl python3 make g++ pkgconf

ENV PYTHON=python3
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x

WORKDIR /app

COPY package.json bun.lock ./
RUN bun install --frozen-lockfile

COPY . .
RUN bun prisma generate

EXPOSE 3000
CMD ["bunx", "prisma", "migrate", "deploy", "&&", "bun", "--hot", "src/main.ts"]
FROM oven/bun:alpine

# Stuff for better-sqlite3
RUN apk add --no-cache openssl curl python3 make g++ pkgconf

ENV PYTHON=python3
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x

WORKDIR /app

COPY package.json bun.lock ./
RUN bun install --frozen-lockfile

COPY . .
RUN bun prisma generate

EXPOSE 3000
CMD ["bunx", "prisma", "migrate", "deploy", "&&", "bun", "--hot", "src/main.ts"]
6 Replies
Ewen
EwenOP3mo ago
any idea ?
bekacru
bekacru3mo ago
you can use bun:sqlite instead
Ewen
EwenOP3mo ago
yea but why do i have a sqlite anyway ? does better-auth create an instance for itself ? because I do not use SQlite at all
Alejandro Montes
did you find a solution for this?
Ewen
EwenOP2mo ago
Nope no answers at all so I gave up
Alejandro Montes
I know this is different but maybe you can do the equivalent on your side? https://discord.com/channels/1288403910284935179/1413158070753820682

Did you find this page helpful?