diff --git a/Dockerfile b/Dockerfile index ef37f925..7bdf3261 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ # use the official Bun image # see all versions at https://hub.docker.com/r/oven/bun/tags -FROM oven/bun:debian as base -WORKDIR /usr/src/app +FROM oven/bun:alpine as base -RUN apt update -RUN apt install git +RUN apk update +RUN apk add curl unzip nodejs npm -RUN git clone https://github.com/rizrmd/prasi-bun --depth=1 -USER bun +RUN mkdir /prasi +RUN curl https://github.com/rizrmd/prasi-bun/archive/refs/heads/main.zip -Lo /prasi/main.zip --verbose +RUN unzip /prasi/main.zip -d /prasi +WORKDIR /prasi/prasi-bun-main RUN bun i -EXPOSE 4550/tcp +RUN cd app/db && bun prisma db pull && bun prisma generate ENTRYPOINT [ "bun", "prod" ] \ No newline at end of file diff --git a/pkgs/core/index.ts b/pkgs/core/index.ts index 06fceb0a..78ecb9ef 100644 --- a/pkgs/core/index.ts +++ b/pkgs/core/index.ts @@ -23,17 +23,17 @@ if (g.mode === "dev") { } await preparePrisma(); -// await ensureNotRunning(); +await ensureNotRunning(); -// if (g.db) { -// g.db.$connect().catch((e: any) => { -// g.log.error(`[DB ERROR]\n${e.message}`); -// }); -// } +if (g.db) { + g.db.$connect().catch((e: any) => { + g.log.error(`[DB ERROR]\n${e.message}`); + }); +} -// createServer(); -// await parcelBuild(); -// await generateAPIFrm(); -// await prepareApiRoutes(); -// await prepareAPITypes(); -// g.status = "ready"; +createServer(); +await parcelBuild(); +await generateAPIFrm(); +await prepareApiRoutes(); +await prepareAPITypes(); +g.status = "ready";