FROM node:20-alpine WORKDIR /app # Install OpenSSL and other required dependencies RUN apk add --no-cache openssl python3 make g++ # Set environment variables ENV DATABASE_URL="postgresql://neondb_owner:npg_rFuv2bygmn6A@ep-purple-queen-a1owplrg-pooler.ap-southeast-1.aws.neon.tech/neondb?sslmode=require" ENV NODE_ENV="production" ENV PORT=3000 # Copy Prisma schema first COPY prisma ./prisma/ # Copy package files COPY package*.json ./ # Install dependencies with legacy peer deps to handle conflicts RUN npm install --legacy-peer-deps # Copy the rest of the application COPY . . # Debug: Check if Prisma schema exists RUN ls -la prisma/ # Generate Prisma client RUN npx prisma generate # Build the application RUN npm run build # Expose the port the app runs on EXPOSE 3000 # Start the application using the standalone server CMD ["node", ".next/standalone/server.js"]