Spaces:
Build error
Build error
File size: 883 Bytes
dca8ede |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
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"] |