From 3c41666231f02f2a2a46bf54bb7ce72e24a0f3b3 Mon Sep 17 00:00:00 2001 From: Oleksandr Honcharov <0976053529@ukr.net> Date: Sun, 25 Aug 2024 22:38:09 +0300 Subject: [PATCH] rework to prisma --- Dockerfile | 3 ++- docker-compose.yml | 5 +++++ src/index.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f425ad..d37726f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,12 +35,13 @@ WORKDIR /app # Copy package.json from build-runner COPY --from=build-runner /tmp/app/package.json /app/package.json +COPY --from=build-runner /tmp/app/node_modules /app/node_modules COPY prisma . COPY .env . # Install dependencies RUN pnpm install --prod -RUN npx prisma migrate deploy +RUN npx prisma generate # Move build files COPY --from=build-runner /tmp/app/build /app/build diff --git a/docker-compose.yml b/docker-compose.yml index af2587b..78b5da0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,11 @@ services: app: build: . command: node build/index.mjs + pull_policy: build + entrypoint: + - "bash" + - "-c" + - "npx prisma migrate deploy && npm start" volumes: - ./db/:/app/db/ environment: diff --git a/src/index.ts b/src/index.ts index 695d60f..0f375b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,7 +27,7 @@ export const bot = new Client({ }) bot.once('ready', async () => { - await bot.initApplicationCommands({ global: { disable: { delete: true } } }) + await bot.initApplicationCommands(true) console.log('Bot started') })