chore: Try and fix the docker build

This commit is contained in:
Jesse Wierzbinski 2023-12-08 17:15:59 -10:00
parent 61f2ce1a2b
commit e34c0aa57c
No known key found for this signature in database
2 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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,
});