Issues deploying with Dockerfile

I'm using SvelteKit, and I run my migrations on app start in hooks.server.ts After building with Dockerfile, I get these runtime errors nonstop:
Node.js v18.20.4
file:///app/node_modules/drizzle-orm/migrator.js:19
throw new Error(`Can't find meta/_journal.json file`);
^

Error: Can't find meta/_journal.json file
at readMigrationFiles (file:///app/node_modules/drizzle-orm/migrator.js:19:11)
at migrate (file:///app/node_modules/drizzle-orm/postgres-js/migrator.js:3:22)
at file:///app/build/server/chunks/hooks.server-ypJT85G1.js:31:1
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v18.20.4
file:///app/node_modules/drizzle-orm/migrator.js:19
throw new Error(`Can't find meta/_journal.json file`);
^

Error: Can't find meta/_journal.json file
at readMigrationFiles (file:///app/node_modules/drizzle-orm/migrator.js:19:11)
at migrate (file:///app/node_modules/drizzle-orm/postgres-js/migrator.js:3:22)
at file:///app/build/server/chunks/hooks.server-ypJT85G1.js:31:1
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Here's my Dockerfile:
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN yarn install
COPY . .
RUN yarn run build

FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
EXPOSE 3000
ENV NODE_ENV=production
CMD ["node", "build"]
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN yarn install
COPY . .
RUN yarn run build

FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
EXPOSE 3000
ENV NODE_ENV=production
CMD ["node", "build"]
1 Reply
x03
x03OP5mo ago
I'm assuming the issue is with my Dockerfile setup, but I havent been able to find any solutions to this online, and I'm not proficient enough with Docker myself to solve it. Okay so it was my docker setup, I just had to add:
COPY --from=builder /app/drizzle drizzle/
COPY --from=builder /app/drizzle drizzle/
Want results from more Discord servers?
Add your server