Fix Docker build again

This commit is contained in:
Jesse Wierzbinski 2024-04-06 23:22:45 -10:00
parent ea1d7b1510
commit 257243aa0c
No known key found for this signature in database
3 changed files with 9 additions and 3 deletions

View file

@ -1,6 +1,6 @@
# Use the official Bun image (Bun doesn't run well on Musl but this seems to work)
# See all versions at https://hub.docker.com/r/oven/bun/tags
FROM imbios/bun-node:1.1.2-current-alpine as base
FROM imbios/bun-node:1.1.2-current-debian as base
# Install dependencies into temp directory
# This will cache them and speed up future builds

View file

@ -26,7 +26,7 @@ await Bun.build({
target: "bun",
splitting: true,
minify: false,
external: ["bullmq"],
external: ["bullmq", "@prisma/client"],
}).then((output) => {
if (!output.success) {
console.log(output.logs);
@ -37,6 +37,11 @@ await Bun.build({
// I apologize for this
await $`sed -i 's|import("node_modules/|import("./node_modules/|g' dist/*.js`;
// Copy generated Prisma client to dist
await $`mkdir -p dist/node_modules/@prisma/client`;
await $`cp -r ${process.cwd()}/node_modules/@prisma/client dist/node_modules/@prisma`;
await $`cp -r ${process.cwd()}/node_modules/.prisma dist/node_modules`;
// Create pages directory
// mkdir ./dist/pages
await mkdir(`${process.cwd()}/dist/pages`);

View file

@ -1,7 +1,8 @@
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
binaryTargets = ["native"]
// These last two lines are important for Docker!
binaryTargets = ["native", "linux-musl-openssl-3.0.x", "linux-musl-arm64-openssl-3.0.x"]
}
generator json {