first commit2
This commit is contained in:
30
Dockerfile
30
Dockerfile
@@ -1,36 +1,26 @@
|
||||
FROM node:20-slim AS base
|
||||
FROM node:20-slim AS deps
|
||||
WORKDIR /app
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
FROM base AS deps
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
COPY prisma ./prisma
|
||||
RUN npm ci
|
||||
|
||||
FROM base AS builder
|
||||
FROM node:20-slim AS builder
|
||||
WORKDIR /app
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY --from=deps /app/prisma ./prisma
|
||||
COPY . .
|
||||
|
||||
RUN npx next build
|
||||
RUN npm run build
|
||||
|
||||
FROM base AS runner
|
||||
FROM nginx:alpine AS runner
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/.next ./.next
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/next.config.mjs ./next.config.mjs
|
||||
COPY --from=builder /app/out /usr/share/nginx/html
|
||||
RUN sed -i 's/listen 80;/listen 3000;/' /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["sh", "-c", "npx prisma migrate deploy && npm run start"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user