mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-18 16:07:10 +00:00
Hotfix
This commit is contained in:
parent
489c73ef77
commit
b915e0066d
13
Dockerfile
13
Dockerfile
@ -4,32 +4,37 @@ FROM node:20-alpine AS builder
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json package-lock.json* ./
|
COPY package.json package-lock.json* ./
|
||||||
|
|
||||||
COPY ./prisma ./prisma
|
COPY ./prisma ./prisma
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production Stage
|
||||||
FROM node:20-alpine AS production
|
FROM node:20-alpine AS production
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
|
|
||||||
|
# Install production dependencies INCLUDING prisma
|
||||||
COPY package.json package-lock.json* ./
|
COPY package.json package-lock.json* ./
|
||||||
RUN npm install --production
|
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 --from=builder /app/node_modules/@prisma /app/node_modules/@prisma
|
COPY --from=builder /app/node_modules/@prisma /app/node_modules/@prisma
|
||||||
|
COPY --from=builder /app/prisma ./prisma
|
||||||
|
|
||||||
|
# Copy built application
|
||||||
COPY --from=builder /app/.next ./.next
|
COPY --from=builder /app/.next ./.next
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder /app/package.json ./package.json
|
COPY --from=builder /app/package.json ./package.json
|
||||||
COPY --from=builder /app/next.config.js* ./
|
COPY --from=builder /app/next.config.js* ./
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["npm", "start"]
|
|
||||||
|
# Run migrations first, then start app
|
||||||
|
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]
|
||||||
Loading…
x
Reference in New Issue
Block a user