mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Hotfix Docker file 'bcrypt' error
This commit is contained in:
21
Dockerfile
21
Dockerfile
@@ -6,9 +6,13 @@ WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
COPY ./prisma ./prisma
|
||||
|
||||
# Install all dependencies (including devDependencies)
|
||||
RUN npm install
|
||||
|
||||
# Generate Prisma client
|
||||
RUN npx prisma generate
|
||||
|
||||
# Build the application
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
@@ -19,13 +23,16 @@ WORKDIR /app
|
||||
|
||||
ENV NODE_ENV production
|
||||
|
||||
# Install production dependencies INCLUDING prisma
|
||||
# Copy package files
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install --production --ignore-scripts
|
||||
|
||||
# Copy needed Prisma files
|
||||
COPY --from=builder /app/node_modules/.prisma /app/node_modules/.prisma
|
||||
COPY --from=builder /app/node_modules/@prisma /app/node_modules/@prisma
|
||||
# Copy node_modules from builder
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
|
||||
# Remove dev dependencies
|
||||
RUN npm prune --production
|
||||
|
||||
# Copy Prisma files
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
|
||||
# Copy built application
|
||||
@@ -36,5 +43,5 @@ COPY --from=builder /app/next.config.js* ./
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
# Run migrations first, then start app
|
||||
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]
|
||||
# Run migrations and start
|
||||
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]
|
||||
|
||||
Reference in New Issue
Block a user