Files
tvone-api/dockerfile
T
peter d207774bd6
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
fix env
2026-04-19 21:07:46 +01:00

32 lines
753 B
Docker

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