fix(docker): align build output structure and fix web 404 error

This commit is contained in:
yiling
2026-06-12 21:24:59 +08:00
parent 91fedf1477
commit 84aa1662be
3 changed files with 18 additions and 3 deletions
+1 -1
View File
@@ -70,4 +70,4 @@ COPY --chown=bun:bun --from=builder /app/prisma.config.ts.prod ./prisma.config.t
EXPOSE 3000
# Default command: run migrations and start API server
CMD ["sh", "-c", "bun prisma migrate deploy && bun apps/web/src/index.js"]
CMD ["sh", "-c", "bun prisma migrate deploy && bun index.js"]
+16 -2
View File
@@ -59,15 +59,29 @@ const server = Bun.serve(
const filepath = join(import.meta.dir, url.pathname)
const file = Bun.file(filepath)
if (await file.exists()) {
return new Response(file)
try {
const stat = await file.stat()
if (stat.isFile()) {
return new Response(file)
}
} catch {
// ignore stat errors
}
}
const htmlFile = Bun.file(join(import.meta.dir, 'shumai-app.html'))
const htmlFile = Bun.file(join(import.meta.dir, 'index.html'))
if (await htmlFile.exists()) {
return new Response(htmlFile, {
headers: { 'Content-Type': 'text/html' },
})
}
const htmlFileNpm = Bun.file(join(import.meta.dir, 'shumai-app.html'))
if (await htmlFileNpm.exists()) {
return new Response(htmlFileNpm, {
headers: { 'Content-Type': 'text/html' },
})
}
}
return app.fetch(req)
+1
View File
@@ -20,6 +20,7 @@ await Bun.build({
target: 'bun',
outdir: outdir,
minify: false,
naming: '[name].[ext]',
plugins: [
temporalWorkflow({
bundleOptions: {},