ca-grow-ops-manager/backend/Dockerfile
fullsizemalt 4bf18d0757
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
fix: Build & Runtime Fixes (TS Lax, Vite Types, Backend OpenSSL)
2025-12-09 11:18:04 -08:00

44 lines
770 B
Docker

FROM node:20-alpine AS builder
# Install OpenSSL for Prisma
RUN apk add --no-cache openssl
WORKDIR /app
# Copy package files
COPY package*.json ./
# Copy prisma directory if it exists, otherwise we'll handle it
COPY prisma ./prisma/
# Install dependencies
RUN npm install
# Copy source
COPY . .
# Generate Prisma Client
RUN npx prisma generate
# Build TypeScript
RUN npm run build
# Production image
FROM node:20-alpine
# Install OpenSSL for Prisma
RUN apk add --no-cache openssl
WORKDIR /app
# Copy built files
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/package*.json ./
# Run as non-root
USER node
EXPOSE 3000
CMD ["node", "dist/server.js"]