This commit is contained in:
Rizky 2023-10-16 07:48:18 +00:00
parent 66d3cd8153
commit 44af8748b7
2 changed files with 20 additions and 19 deletions

View File

@ -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" ]

View File

@ -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";