fix prisma
This commit is contained in:
parent
1c710ee34d
commit
7458aad85a
31
Dockerfile
31
Dockerfile
|
|
@ -1,27 +1,10 @@
|
|||
# use the official ubuntu image
|
||||
FROM ubuntu:latest as base
|
||||
WORKDIR /usr/src
|
||||
FROM oven/bun:1.0.18-debian as base
|
||||
WORKDIR /usr/src/prasi
|
||||
|
||||
RUN echo $DATABASE_URL
|
||||
COPY . .
|
||||
RUN bun install
|
||||
RUN bun run build
|
||||
|
||||
# COPY . .
|
||||
|
||||
# RUN apt-get update
|
||||
# RUN apt-get install -y curl unzip zip bash gnupg
|
||||
|
||||
# RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
|
||||
# RUN apt-get -y install nodejs
|
||||
# RUN npm install -g pm2
|
||||
# RUN npm install -g node-gyp
|
||||
# RUN npm install -g node-gyp-build-optional-packages
|
||||
|
||||
# RUN curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.18"
|
||||
# RUN ln -s $HOME/.bun/bin/bun /usr/local/bin/bun
|
||||
|
||||
# RUN bun repl -e 'console.log(process.env["DATABASE_URL"]);'
|
||||
# RUN bun install
|
||||
# RUN bun run build
|
||||
# RUN cd app/db && bun prisma db pull && bun prisma generate
|
||||
|
||||
# EXPOSE 3000
|
||||
# CMD [ "pm2-runtime", "bun run prod" ]
|
||||
EXPOSE 3000
|
||||
CMD [ "bun run prod" ]
|
||||
|
|
|
|||
|
|
@ -5,10 +5,9 @@ import { g } from "./global";
|
|||
|
||||
export const preparePrisma = async () => {
|
||||
if (await existsAsync(dir.path("app/db/.env"))) {
|
||||
const hasPrisma = await existsAsync(dir.path("node_modules/.prisma"));
|
||||
if (!hasPrisma) {
|
||||
await $({ cwd: dir.path(`app/db`) })`bun prisma generate`;
|
||||
}
|
||||
g.log.info("Prisma: db pull & generate");
|
||||
await $({ cwd: dir.path(`app/db`) })`bun prisma db pull`;
|
||||
await $({ cwd: dir.path(`app/db`) })`bun prisma generate`;
|
||||
|
||||
const { PrismaClient } = await import("../../../app/db/db");
|
||||
g.db = new PrismaClient();
|
||||
|
|
|
|||
Loading…
Reference in New Issue