refactor(bootstrap): avoid duplicate event firing
Some checks failed
Release Workflow / determine-release-type (push) Has been cancelled
Release Workflow / checks (push) Has been cancelled
Release Workflow / e2e-tests (push) Has been cancelled
Release Workflow / build-images (push) Has been cancelled
Release Workflow / publish-release (push) Has been cancelled

This commit is contained in:
Nicolas Meienberger 2026-02-13 20:37:12 +01:00
parent 436a63a4b4
commit ca2a2cb74f
3 changed files with 10 additions and 3 deletions

View file

@ -100,7 +100,6 @@ ENV PORT=4096
WORKDIR /app
COPY --from=builder /app/package.json ./
RUN bun install --production --frozen-lockfile && rm -rf $HOME/.bun/install/cache
COPY --from=deps /deps/restic /usr/local/bin/restic
COPY --from=deps /deps/rclone /usr/local/bin/rclone

View file

@ -1,16 +1,23 @@
import { logger } from "./server/utils/logger";
import { shutdown } from "./server/modules/lifecycle/shutdown";
import { runCLI } from "./server/cli";
import { bootstrapApplication } from "./server/modules/lifecycle/bootstrap";
import { createStartHandler, defaultStreamHandler, defineHandlerCallback } from "@tanstack/react-start/server";
import { createServerEntry } from "@tanstack/react-start/server-entry";
import { initAuth } from "~/server/lib/auth";
import { setSchema } from "./server/db/db";
import * as schema from "./server/db/schema";
import { toMessage } from "./server/utils/errors";
const cliRun = await runCLI(Bun.argv);
if (cliRun) {
process.exit(0);
}
await bootstrapApplication();
setSchema(schema);
await initAuth().catch((err) => {
logger.error(`Error initializing auth: ${toMessage(err)}`);
throw err;
});
const customHandler = defineHandlerCallback((ctx) => {
return defaultStreamHandler(ctx);

View file

@ -43,6 +43,7 @@ services:
- APP_SECRET=94bad4678ce84a60b9789bd2114a6bf780aeb38df426f7352c941c66e25d5c2b
- BASE_URL=http://localhost:4096
- PORT=4096
- LOG_LEVEL=debug
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/lib/zerobyte:/var/lib/zerobyte