This commit is contained in:
Bivekich
2025-08-06 12:51:55 +03:00
parent 162d96e9aa
commit 8ee7bc896d
4 changed files with 67 additions and 4 deletions

View File

@ -7,8 +7,14 @@ WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Install all dependencies (including dev dependencies for build)
RUN npm ci
# Copy prisma schema
COPY prisma ./prisma/
# Generate Prisma client
RUN npx prisma generate
# Copy project files
COPY . .
@ -23,11 +29,22 @@ WORKDIR /app
ENV NODE_ENV=production
# Create non-root user
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Copy necessary files from builder
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder /app/prisma ./prisma
# Set correct permissions
RUN chown -R nextjs:nodejs /app
USER nextjs
EXPOSE 3000