mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
Fix Docker build again
This commit is contained in:
parent
ea1d7b1510
commit
257243aa0c
|
|
@ -1,6 +1,6 @@
|
||||||
# Use the official Bun image (Bun doesn't run well on Musl but this seems to work)
|
# 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
|
# 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
|
# Install dependencies into temp directory
|
||||||
# This will cache them and speed up future builds
|
# This will cache them and speed up future builds
|
||||||
|
|
|
||||||
7
build.ts
7
build.ts
|
|
@ -26,7 +26,7 @@ await Bun.build({
|
||||||
target: "bun",
|
target: "bun",
|
||||||
splitting: true,
|
splitting: true,
|
||||||
minify: false,
|
minify: false,
|
||||||
external: ["bullmq"],
|
external: ["bullmq", "@prisma/client"],
|
||||||
}).then((output) => {
|
}).then((output) => {
|
||||||
if (!output.success) {
|
if (!output.success) {
|
||||||
console.log(output.logs);
|
console.log(output.logs);
|
||||||
|
|
@ -37,6 +37,11 @@ await Bun.build({
|
||||||
// I apologize for this
|
// I apologize for this
|
||||||
await $`sed -i 's|import("node_modules/|import("./node_modules/|g' dist/*.js`;
|
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
|
// Create pages directory
|
||||||
// mkdir ./dist/pages
|
// mkdir ./dist/pages
|
||||||
await mkdir(`${process.cwd()}/dist/pages`);
|
await mkdir(`${process.cwd()}/dist/pages`);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
previewFeatures = ["postgresqlExtensions"]
|
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 {
|
generator json {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue