mirror of
https://github.com/duongcamcute/tech-gadget-manager.git
synced 2026-06-28 14:55:47 +00:00
Fix: Install OpenSSL and fix Prisma permission issues in Docker
This commit is contained in:
@@ -24,6 +24,11 @@ RUN npm run build
|
||||
|
||||
# Production image, copy all the files and run next
|
||||
FROM base AS runner
|
||||
# Install OpenSSL (required for Prisma) and Prisma CLI globally directly as root
|
||||
# We install prisma@5.22.0 to match project dependencies
|
||||
RUN apk add --no-cache openssl && \
|
||||
npm install -g prisma@5.22.0
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV production
|
||||
@@ -42,9 +47,6 @@ COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
||||
# Copy entrypoint script
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/docker-entrypoint.sh ./
|
||||
|
||||
# Install prisma CLI explicitly in the runner so we can migrate
|
||||
RUN npm install -g prisma@5.22.0
|
||||
|
||||
# Set permissions
|
||||
RUN chmod +x ./docker-entrypoint.sh
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ set -e
|
||||
|
||||
# Chạy migration database (tạo bảng nếu chưa có)
|
||||
echo "Running database migrations..."
|
||||
npx prisma migrate deploy
|
||||
prisma migrate deploy
|
||||
|
||||
# Chạy ứng dụng Next.js
|
||||
echo "Starting Next.js application..."
|
||||
|
||||
Reference in New Issue
Block a user