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') })