From e34c0aa57c7a32e2896d5b6ce05843f1c4e8144f Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Fri, 8 Dec 2023 17:15:59 -1000 Subject: [PATCH] chore: Try and fix the docker build --- Dockerfile | 6 +++--- build.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 786c3492..36ad1b37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,9 @@ RUN bun install --frozen-lockfile --production. RUN bunx --bun vite build pages # Build the project -RUN ls -la -RUN bun run build.ts +RUN bun build --entrypoints ./index.ts ./prisma.ts ./cli.ts --outdir dist --target bun --splitting --minify --external bullmq --external @prisma/client +RUN mkdir ./dist/pages +RUN cp -r ./pages/dist ./dist/pages WORKDIR /temp/dist # copy production dependencies and source code into final image @@ -31,7 +32,6 @@ FROM base AS release # Create app directory RUN mkdir -p /app COPY --from=install /temp/dist /app/dist -COPY --from=install /temp/pages /app/pages COPY entrypoint.sh /app diff --git a/build.ts b/build.ts index 24a1ea1a..57b3bbc5 100644 --- a/build.ts +++ b/build.ts @@ -12,6 +12,7 @@ await rm("./dist", { recursive: true }); await mkdir(process.cwd() + "/dist"); +//bun build --entrypoints ./index.ts ./prisma.ts ./cli.ts --outdir dist --target bun --splitting --minify --external bullmq,@prisma/client await Bun.build({ entrypoints: [ process.cwd() + "/index.ts", @@ -26,9 +27,11 @@ await Bun.build({ }); // Create pages directory +// mkdir ./dist/pages await mkdir(process.cwd() + "/dist/pages"); // Copy Vite build output to dist +// cp -r ./pages/dist ./dist/pages await cp(process.cwd() + "/pages/dist", process.cwd() + "/dist/pages/", { recursive: true, });