2026-04-18 00:33:27 +01:00
|
|
|
FROM node:22-alpine
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Enable pnpm
|
|
|
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
|
|
|
|
|
|
# Install deps
|
|
|
|
|
COPY package.json pnpm-lock.yaml ./
|
2026-04-19 21:04:40 +01:00
|
|
|
# Important: ensure prisma is installed
|
2026-04-18 00:33:27 +01:00
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
2026-04-19 21:04:40 +01:00
|
|
|
# Copy Prisma schema specifically before generating
|
|
|
|
|
# Replace 'prisma/schema.prisma' with your actual path if different
|
|
|
|
|
COPY prisma ./prisma/
|
2026-04-18 00:33:27 +01:00
|
|
|
|
2026-04-19 21:04:40 +01:00
|
|
|
# Generate Prisma Client for the Linux environment
|
|
|
|
|
RUN npx prisma generate
|
2026-04-19 20:18:09 +01:00
|
|
|
|
2026-04-19 21:04:40 +01:00
|
|
|
# Copy the rest of the source
|
|
|
|
|
COPY . .
|
2026-04-19 20:04:51 +01:00
|
|
|
|
2026-04-18 00:33:27 +01:00
|
|
|
# Build NestJS
|
|
|
|
|
RUN pnpm build
|
|
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
2026-04-19 21:07:46 +01:00
|
|
|
# Ensure env exists (optional safety for containers)
|
|
|
|
|
RUN if [ ! -f .env ] && [ -f .env.example ]; then cp .env.example .env; fi
|
|
|
|
|
|
2026-04-19 21:04:40 +01:00
|
|
|
# Using the path confirmed in your previous logs
|
2026-04-19 20:39:48 +01:00
|
|
|
CMD ["node", "dist/src/main.js"]
|