rework to prisma

This commit is contained in:
Oleksandr Honcharov 2024-08-25 22:38:09 +03:00
parent fd558bd975
commit 3c41666231
3 changed files with 8 additions and 2 deletions

View File

@ -35,12 +35,13 @@ WORKDIR /app
# Copy package.json from build-runner # Copy package.json from build-runner
COPY --from=build-runner /tmp/app/package.json /app/package.json 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 prisma .
COPY .env . COPY .env .
# Install dependencies # Install dependencies
RUN pnpm install --prod RUN pnpm install --prod
RUN npx prisma migrate deploy RUN npx prisma generate
# Move build files # Move build files
COPY --from=build-runner /tmp/app/build /app/build COPY --from=build-runner /tmp/app/build /app/build

View File

@ -2,6 +2,11 @@ services:
app: app:
build: . build: .
command: node build/index.mjs command: node build/index.mjs
pull_policy: build
entrypoint:
- "bash"
- "-c"
- "npx prisma migrate deploy && npm start"
volumes: volumes:
- ./db/:/app/db/ - ./db/:/app/db/
environment: environment:

View File

@ -27,7 +27,7 @@ export const bot = new Client({
}) })
bot.once('ready', async () => { bot.once('ready', async () => {
await bot.initApplicationCommands({ global: { disable: { delete: true } } }) await bot.initApplicationCommands(true)
console.log('Bot started') console.log('Bot started')
}) })