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 package.json package-lock.json* ./
|
||||||
COPY ./prisma ./prisma
|
COPY ./prisma ./prisma
|
||||||
|
|
||||||
|
# Install all dependencies (including devDependencies)
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
|
# Generate Prisma client
|
||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
|
|
||||||
|
# Build the application
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
@@ -19,13 +23,16 @@ WORKDIR /app
|
|||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
|
|
||||||
# Install production dependencies INCLUDING prisma
|
# Copy package files
|
||||||
COPY package.json package-lock.json* ./
|
COPY package.json package-lock.json* ./
|
||||||
RUN npm install --production --ignore-scripts
|
|
||||||
|
|
||||||
# Copy needed Prisma files
|
# Copy node_modules from builder
|
||||||
COPY --from=builder /app/node_modules/.prisma /app/node_modules/.prisma
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
COPY --from=builder /app/node_modules/@prisma /app/node_modules/@prisma
|
|
||||||
|
# Remove dev dependencies
|
||||||
|
RUN npm prune --production
|
||||||
|
|
||||||
|
# Copy Prisma files
|
||||||
COPY --from=builder /app/prisma ./prisma
|
COPY --from=builder /app/prisma ./prisma
|
||||||
|
|
||||||
# Copy built application
|
# Copy built application
|
||||||
@@ -36,5 +43,5 @@ COPY --from=builder /app/next.config.js* ./
|
|||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Run migrations first, then start app
|
# Run migrations and start
|
||||||
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]
|
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]
|
||||||
|
|||||||
Reference in New Issue
Block a user