bun seems to be broken/extremly slow in bun mode when running the tests, so swapping to deno to try that

This commit is contained in:
Chris Kruining 2025-02-19 17:21:50 +11:00
parent 3ef8940137
commit 2362291e90
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
5 changed files with 4843 additions and 22 deletions

View file

@ -1,14 +1,14 @@
FROM oven/bun:1 AS base
FROM docker.io/denoland/deno:latest AS base
WORKDIR /usr/src/app
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lock /temp/dev
RUN cd /temp/dev && bun install --frozen-lockfile
COPY package.json deno.lock /temp/dev
RUN cd /temp/dev && deno install --frozen
RUN mkdir -p /temp/prod
COPY package.json bun.lock /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
COPY package.json deno.lock /temp/prod/
RUN cd /temp/prod && deno install --frozen
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
@ -16,19 +16,19 @@ COPY . .
RUN echo "SESSION_SECRET=$(head -c 64 /dev/random | base64)" > .env
ENV NODE_ENV=production
ENV SERVER_PRESET=bun
RUN bun run test
ENV SERVER_PRESET=deno
RUN deno run test
RUN chmod +x node_modules/.bin/*
RUN bun run build
RUN deno run build
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app/.env .
COPY --from=prerelease /usr/src/app/bun.lock .
COPY --from=prerelease /usr/src/app/deno.lock .
COPY --from=prerelease /usr/src/app/package.json .
COPY --from=prerelease /usr/src/app/.vinxi .vinxi
COPY --from=prerelease /usr/src/app/.output .output
USER bun
USER deno
EXPOSE 3000
ENTRYPOINT [ "bun", "run", "start" ]
ENTRYPOINT [ "deno", "run", "start" ]