mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
chore: Try and fix the docker build
This commit is contained in:
parent
61f2ce1a2b
commit
e34c0aa57c
|
|
@ -21,8 +21,9 @@ RUN bun install --frozen-lockfile --production.
|
||||||
RUN bunx --bun vite build pages
|
RUN bunx --bun vite build pages
|
||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
RUN ls -la
|
RUN bun build --entrypoints ./index.ts ./prisma.ts ./cli.ts --outdir dist --target bun --splitting --minify --external bullmq --external @prisma/client
|
||||||
RUN bun run build.ts
|
RUN mkdir ./dist/pages
|
||||||
|
RUN cp -r ./pages/dist ./dist/pages
|
||||||
WORKDIR /temp/dist
|
WORKDIR /temp/dist
|
||||||
|
|
||||||
# copy production dependencies and source code into final image
|
# copy production dependencies and source code into final image
|
||||||
|
|
@ -31,7 +32,6 @@ FROM base AS release
|
||||||
# Create app directory
|
# Create app directory
|
||||||
RUN mkdir -p /app
|
RUN mkdir -p /app
|
||||||
COPY --from=install /temp/dist /app/dist
|
COPY --from=install /temp/dist /app/dist
|
||||||
COPY --from=install /temp/pages /app/pages
|
|
||||||
COPY entrypoint.sh /app
|
COPY entrypoint.sh /app
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
3
build.ts
3
build.ts
|
|
@ -12,6 +12,7 @@ await rm("./dist", { recursive: true });
|
||||||
|
|
||||||
await mkdir(process.cwd() + "/dist");
|
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({
|
await Bun.build({
|
||||||
entrypoints: [
|
entrypoints: [
|
||||||
process.cwd() + "/index.ts",
|
process.cwd() + "/index.ts",
|
||||||
|
|
@ -26,9 +27,11 @@ await Bun.build({
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create pages directory
|
// Create pages directory
|
||||||
|
// mkdir ./dist/pages
|
||||||
await mkdir(process.cwd() + "/dist/pages");
|
await mkdir(process.cwd() + "/dist/pages");
|
||||||
|
|
||||||
// Copy Vite build output to dist
|
// Copy Vite build output to dist
|
||||||
|
// cp -r ./pages/dist ./dist/pages
|
||||||
await cp(process.cwd() + "/pages/dist", process.cwd() + "/dist/pages/", {
|
await cp(process.cwd() + "/pages/dist", process.cwd() + "/dist/pages/", {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue