Add Prisma CLI to production image
This commit is contained in:
1 parent
6444ad2fa8
commit
d58acdece6
1 file changed
+4
-1
+4
-1
@@ -37,13 +37,16 @@ ENV NEXT_TELEMETRY_DISABLED 1
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
# Install Prisma CLI for db push command
|
||||
RUN npm install -g prisma
|
||||
|
||||
# Copy necessary files from builder
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/.prisma ./node_modules/.prisma
|
||||
|
||||
# Create database directory
|
||||
# Create database directory and set permissions
|
||||
RUN mkdir -p /app/prisma && chown -R nextjs:nodejs /app
|
||||
|
||||
USER nextjs
|
||||
|
||||
Reference in new issue
Block a user